Skip to content

Instantly share code, notes, and snippets.

@digitaljhelms
digitaljhelms / gist:4287848
Last active April 23, 2024 21:43
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@lukemorton
lukemorton / README.markdown
Created June 4, 2011 13:32
Set caret position via jQuery

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 ] )

@unixb0y
unixb0y / hosts
Created April 25, 2018 13:00
hosts file for blocking basically all Google connections
##
# Put this AFTER your current
# /etc/hosts file contents!
# After that, either reboot or
# manually flush your DNS cache
##
127.0.0.1 google.com #} redirects to us2.startpage.com:443
127.0.0.1 www.google.com #} 216.218.239.164 is the IP address for the
127.0.0.1 google.ca #} Google frontend Startpage and automatically
@sahilsk
sahilsk / load-and-stress-testing-tools.md
Last active January 11, 2024 13:14
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 http://127.0.0.1:8080/index.html
@jkp
jkp / websocketserver.py
Created July 18, 2012 13:28
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'
@vdel26
vdel26 / nginx
Last active March 16, 2023 20:31
Openresty init.d script
#!/bin/sh
#
# 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
#
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
@ravisorg
ravisorg / test-hashtag-regexp.php
Last active December 13, 2018 05:50
pnut.io unicode hashtag parser
<?php
// You can find the test data file at https://www.ravis.org/hashtag-test.zip
// 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)