Skip to content

Instantly share code, notes, and snippets.

Focusing on playing ;)

Kamrul Ahsan k4mrul

Focusing on playing ;)
Block or report user

Report or block k4mrul

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
azizultex / Piklist Widget with Group Fields
Last active Feb 7, 2019
Piklist Widget with Group Fields
View Piklist Widget with Group Fields
piklist('field', array(
'type' => 'text'
,'field' => 'title'
,'label' => 'Title'
piklist('field', array(
'type' => 'group'
#Put in /etc/
#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/" /etc/crontabs/root || echo "0 4 * * 0,3 sh /etc/" >> /etc/crontabs/root
lukecav / functions.php
Last active Oct 2, 2019 — forked from eteubert/wordpress-passwort-reset-unmultisite.php
WordPress Multisite: Password Reset on a Subsite.
View functions.php
* Password reset on sub site (1 of 4)
* Replace login page "Lost Password?" urls.
* @param string $lostpassword_url The URL for retrieving a lost password.
* @param string $redirect The path to redirect to.
* @return string
* @since 1.0.0
View Listen on UDP using netcat
# create an UDP server using nc on port 11090
nc -ul 11090
# check whether an UDP server is listening on 11190
nc -vz -u <hostname> 11090
# send a packet to the UDP server
echo -n "hello" | nc -4u -w1 <hostname> 1118
cuth /
Last active Dec 24, 2019
Find the elements that are causing a horizontal scroll. Based on

Debug Horizontal Scroll

(function (d) {
    var w = d.documentElement.offsetWidth,
        t = d.createTreeWalker(d.body, NodeFilter.SHOW_ELEMENT),
    while (t.nextNode()) {
        b = t.currentNode.getBoundingClientRect();
        if (b.right > w || b.left < 0) {
stephenharris / copy-pre.css
Last active Dec 30, 2019
Adding a 'copy' button to <pre> content
View copy-pre.css
.pre-wrapper pre{
padding-top: 25px;
.pre-wrapper .copy-snippet {
border-radius: 0;
background: none repeat scroll 0 0 transparent;
akosveres / mariadb.yml
Last active Jan 16, 2020
Mariadb + phpmyadmin docker-compose
View mariadb.yml
version: "2"
image: mariadb
- ./database:/var/lib/mysql
glof2 / spacepaper.pyw
Last active Feb 7, 2020
Sets your wallpaper to NASA's picture of the day
View spacepaper.pyw
import requests
from bs4 import BeautifulSoup
from os import path, getcwd
import ctypes
import time
def windowswallpaper(image):
ctypes.windll.user32.SystemParametersInfoW(SPI_SETDESKWALLPAPER, 0, image, 0)
lrhache /
Last active Feb 23, 2020
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.

huraji / php.ini
Last active Mar 11, 2020
Optimal php.ini configuration for Wordpress, see also
View php.ini
# Wordpress php.ini configuration
upload_max_filesize = 32M
post_max_size = 32M
memory_limit = 128M
max_execution_time = 60
max_input_vars = 10000
max_input_time = 30
You can’t perform that action at this time.