Skip to content

Instantly share code, notes, and snippets.

View CypherpunkSamurai's full-sized avatar
😶
Currently Busy 🌻🐢

Cypherpunk Samurai CypherpunkSamurai

😶
Currently Busy 🌻🐢
View GitHub Profile
@chandlerprall
chandlerprall / threaded_download.py
Created June 9, 2011 17:41
Small Python multi-threaded file downloader
import urllib2
import threading
from Queue import Queue
import sys, os, re
class ThreadedDownload(object):
REGEX = {
'hostname_strip':re.compile('.*\..*?/', re.I)
}
@TobiX
TobiX / Protocol.pm
Created August 1, 2011 22:21
Minecraft "protocol parser"
package MineCrap::Protocol;
use common::sense;
use Moose;
use Moose::Util::TypeConstraints;
#use namespace::autoclean;
use Data::ParseBinary;
use MineCrap::Protocol::CompressionAdapter;
use MineCrap::Protocol::DoubleAdapter;
use MineCrap::Protocol::UCS2Adapter;
@maluta
maluta / dalvik.sh
Created October 5, 2011 13:12
Command line Java on DalvikVM
#!/bin/sh
DIR="tmp_"$$
JAR=`echo $1 | tr '.' ' ' | awk '{ print $1 }'`
rm -rf $JAR.jar
mkdir $DIR
cp $1 $DIR
cd $DIR
echo "** Compiling java file..."
javac -d . -g $1
echo "** Creating temporary jar..."
@sindresorhus
sindresorhus / simplexhr.js
Created January 9, 2012 15:19
Simple XMLHttpRequest wrapper
var xhr = function() {
var xhr = new XMLHttpRequest();
return function( method, url, callback ) {
xhr.onreadystatechange = function() {
if ( xhr.readyState === 4 ) {
callback( xhr.responseText );
}
};
xhr.open( method, url );
xhr.send();
@deoxxa
deoxxa / Makefile
Created May 24, 2012 14:35
Silly zero-copy minecraft protocol parser idea!
CFLAGS += -std=c99 -Wall -Werror -Wextra -pedantic -O0 -g
all: test
parser.o: parser.c
$(CC) $(CFLAGS) $(LDFLAGS) -c -o parser.o parser.c
test.o: test.c
$(CC) $(CFLAGS) $(LDFLAGS) -c -o test.o test.c
@herrbuerger
herrbuerger / README
Created September 8, 2012 07:09 — forked from amcclosky/README
Anonymous Rotating Proxies with Monit, Tor, Haproxy and Delegated. Idea by http://blog.databigbang.com/running-your-own-anonymous-rotating-proxies/
0 - Read http://blog.databigbang.com/running-your-own-anonymous-rotating-proxies/
1 - Install monit, haproxy, tor and delegated.
2 - Setup your environment in the setup.rb file
3 - Just run > ruby setup.rb
4 - ...........
5 - PROFIT! > http://www.southparkstudios.com/clips/151040/the-underpants-business
@awidegreen
awidegreen / vim_cheatsheet.md
Last active April 10, 2025 20:01
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@chitacan
chitacan / sticker.sh
Last active June 24, 2022 07:57
Small shell script to find process id via android shell and attach "strace" to it.
#!/usr/bin/env bash
version="0.0.1"
TARGET_PROCESS=$1
if [ ! $TARGET_PROCESS ]; then
echo
echo "Usage: sticker [process name]"
echo
@cobyism
cobyism / gh-pages-deploy.md
Last active April 12, 2025 09:10
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@lithid
lithid / Grid
Created February 20, 2013 02:05
Here is a grid using python and GTK3, loading dynamically based on window size/re-size. I came up with this example while trying to mimic a gridview of images for a wallpaper application. The example is below.
#!/usr/bin/env python2
from gi.repository import Gtk
class Grid(Gtk.Window):
widget_list = []
WIDGET_SIZE = 140
COLS = 1
NUM = 100
def calcule_columns(self, scroll, grid):