Skip to content

Instantly share code, notes, and snippets.

unixb0y / hosts
Created Apr 25, 2018
hosts file for blocking basically all Google connections
View hosts
# Put this AFTER your current
# /etc/hosts file contents!
# After that, either reboot or
# manually flush your DNS cache
## #} redirects to #} is the IP address for the #} Google frontend Startpage and automatically
ravisorg / test-hashtag-regexp.php
Last active Dec 13, 2018 unicode hashtag parser
View test-hashtag-regexp.php
// You can find the test data file at
// You're gonna want to have your console output supporting UTF8 before running this, or you're
// gonna see a bunch of ? in the output...
// For curiosity's sake, post number 693,847 is an emoji hashtag: #(heart)
sahilsk /
Last active Mar 27, 2020
Load and stress testing tools

wrk is a modern HTTP benchmarking tool capable of generating significant load when run on a single multi-core CPU. It combines a multithreaded design with scalable event notification systems such as epoll and kqueue.

Basic Usage

wrk -t12 -c400 -d30s
vdel26 / nginx
Last active Apr 16, 2021
Openresty init.d script
View nginx
# chkconfig: 2345 55 25
# Description: Nginx init.d script, put in /etc/init.d, chmod +x /etc/init.d/nginx
# For Debian, run: update-rc.d -f nginx defaults
# For CentOS, run: chkconfig --add nginx
# Provides: nginx
# Required-Start: $all
digitaljhelms / gist:4287848
Last active Jul 28, 2021
Git/GitHub branching standards & conventions
View gist:4287848


Quick Legend

Instance Branch Description, Instructions, Notes
jkp /
Created Jul 18, 2012
A simple WebSockets server with no dependencies
import struct
import SocketServer
from base64 import b64encode
from hashlib import sha1
from mimetools import Message
from StringIO import StringIO
class WebSocketsHandler(SocketServer.StreamRequestHandler):
magic = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
lukemorton / README.markdown
Created Jun 4, 2011
Set caret position via jQuery
View README.markdown

jQuery Caret

This is a very simple lightweight plugin to allow you to move the caret (or cursor) position in an <input /> or <textarea> element.

By exposing three jQuery.fn methods you can easily move a a caret to any position you like:

$.fn.caretTo( index , [ offset ] )