Skip to content

Instantly share code, notes, and snippets.

View k4mrul's full-sized avatar
😎
Keep smiling ;)

Abdul Hannan Kamrul k4mrul

😎
Keep smiling ;)
View GitHub Profile
@j4mie
j4mie / normalise.py
Created August 30, 2010 12:44
Normalise (normalize) unicode data in Python to remove umlauts, accents etc.
# -*- coding: utf-8 -*-
import unicodedata
""" Normalise (normalize) unicode data in Python to remove umlauts, accents etc. """
data = u'naïve café'
normal = unicodedata.normalize('NFKD', data).encode('ASCII', 'ignore')
print normal
Installing Arch:
sudo vim /etc/pacman.conf
Update packages list: sudo pacman -Syy
run sudo pacman -Syu before installing any software (to update the repositories first)
* Timing issue:
- Change hardware clock to use UTC time:
sudo timedatectl set-local-rtc 0
@rxaviers
rxaviers / gist:7360908
Last active April 23, 2024 19:14
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@lrhache
lrhache / python-selenium-open-tab.md
Last active June 10, 2023 13:49
Python Selenium - Open new tab / focus tab / close tab

On a recent project, I ran into an issue with Python Selenium webdriver. There's no easy way to open a new tab, grab whatever you need and return to original window opener.

Here's a couple people who ran into the same complication:

So, after many minutes (read about an hour) of searching, I decided to do find a quick solution to this problem.

@consti
consti / hosts
Last active April 23, 2024 19:50
/etc/hosts to block shock sites etc.
# This hosts file is brought to you by Dan Pollock and can be found at
# http://someonewhocares.org/hosts/
# You are free to copy and distribute this file for non-commercial uses,
# as long the original URL and attribution is included.
#<localhost>
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
255.255.255.255 broadcasthost
::1 localhost
@chrisjhoughton
chrisjhoughton / proxy.apache.conf
Last active August 9, 2023 10:17
Sample Nginx reverse proxy to Apache set up for Wordpress.
<VirtualHost *:{PORT}>
ServerName www.yourdomain.com
ServerAdmin mail@domain.com
DocumentRoot /var/www/yourdir/
<Directory /var/www/yourdir>
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
@hieblmedia
hieblmedia / .gitignore
Last active March 20, 2024 01:22
Gitignore - Exclude all except specific subdirectory
#
# If all files excluded and you will include only specific sub-directories
# the parent path must matched before.
#
/**
!/.gitignore
###############################
# Un-ignore the affected subdirectory
@ruzickap
ruzickap / openwrt_wireless.sh
Created April 6, 2014 16:55
OpenWrt WiFi configuration tweaks
uci set wireless.radio0.channel=8
uci set wireless.radio0.htmode=HT40-
uci set wireless.radio0.noscan=1
uci set wireless.radio0.bursting=1
uci set wireless.radio0.ff=1
uci set wireless.radio0.compression=1
uci set wireless.radio0.xr=1
uci set wireless.radio0.ar=1
uci set wireless.radio0.txpower=20
@Cybso
Cybso / adblock.sh
Last active September 3, 2021 18:07 — forked from teffalump/README.md
#!/bin/sh
#Put in /etc/adblock.sh
#Script to grab and sort a list of adservers and malware
#Check proper DHCP config and, if necessary, update it
uci get dhcp.@dnsmasq[0].addnhosts > /dev/null 2>&1 || uci add_list dhcp.@dnsmasq[0].addnhosts=/etc/block.hosts && uci commit
#Leave crontab alone, or add to it
grep -q "/etc/adblock.sh" /etc/crontabs/root || echo "0 4 * * 0,3 sh /etc/adblock.sh" >> /etc/crontabs/root
@jbinfo
jbinfo / scrapy_csv_exporter.md
Last active March 7, 2022 05:49
How to create a Scrapy CSV Exporter with a custom delimiter and order fields

Create a scrapy exporter on the root of your scrapy project, we suppose the name of your project is my_project, we can name this exporter: my_project_csv_item_exporter.py

from scrapy.conf import settings
from scrapy.contrib.exporter import CsvItemExporter

class MyProjectCsvItemExporter(CsvItemExporter):

    def __init__(self, *args, **kwargs):
 delimiter = settings.get('CSV_DELIMITER', ',')