Skip to content

Instantly share code, notes, and snippets.

View someburner's full-sized avatar

Jeff Hufford someburner

View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active April 14, 2025 11:07
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@weakish
weakish / backup-providers.md
Last active August 30, 2024 09:57
reviews of vps, storage, mail forward
@markjaquith
markjaquith / .all
Last active October 10, 2018 15:38
Bash stuff
for f in ~/Dropbox/bash/*; do source $f; done
@jordanorelli
jordanorelli / client.go
Created May 7, 2012 17:16
rpc server example in go
package main
import (
"bufio"
"log"
"net/rpc"
"os"
)
func main() {
@Espenhh
Espenhh / branch-blame.sh
Created September 29, 2012 14:55
Script that lists out all branches, how old they are, groups them by merged/notmerged, and "blames" who commited last
#!/bin/bash
# --------------------------- FUNCTIONS ---------------------------------
_line() {
printf %80s |tr " " "-"; echo ""
}
_info() {
echo -e 1>&2 "\033[32m"$@"\033[0m"
}
@C0deH4cker
C0deH4cker / hacky.c
Created September 19, 2013 08:00
Hackiest preprocessor macros I may have ever written, yet they surprisingly work for every test case I've thrown at them. Enjoy ;)
/*
hacky.c
Written on 9/19/13 by @C0deH4cker for reasons unknown.
Inspired by http://carolina.mff.cuni.cz/~trmac/blog/2005/the-ugliest-c-feature-tgmathh/
DISCLAIMER:
No preprocessors were harmed in the creation of this code.
*/
/*
@gnpkrish
gnpkrish / tornado_websocket_ee.py
Created January 15, 2014 12:23
Realtime Communicating with front-end using simple EventEmitter. With use of Tornado + Websocket.
"""
This is a simple example of WebSocket + Tornado + Simple EventEmitters usage.
Thanks to pyee by https://github.com/jesusabdullah
@Author:: Narayanaperumal G <[email protected]>
"""
import tornado.httpserver
import tornado.websocket
import tornado.ioloop
import tornado.web
from collections import defaultdict
@AGWA
AGWA / rpi-hdmi.sh
Last active January 10, 2025 16:18
Enable and disable the HDMI port on the Raspberry Pi: `rpi-hdmi on` to turn on, `rpi-hdmi off` to turn off. X is properly reinitialized when re-enabling.
#!/bin/sh
# Enable and disable HDMI output on the Raspberry Pi
is_off ()
{
tvservice -s | grep "TV is off" >/dev/null
}
case $1 in
@kylemcdonald
kylemcdonald / main.cpp
Created April 24, 2014 22:06
Example of using libpcap with openFrameworks in monitor mode in OS X (probably similar on Linux). By default we are only watching for probe request frames.
// make sure to link against /usr/lib/libpcap.dylib
#include "ofMain.h"
#include <pcap/pcap.h>
class ofApp : public ofBaseApp {
public:
pcap_t *pcap;
struct pcap_pkthdr header;
const unsigned char* packet = NULL;
list<string> packetHex;
def xtick_formatter(x, fmt, td, p):
res = None
if x < p[-1][0]:
res = (p[-1][1] + (x - p[-1][0]) * td).strftime(fmt)
else:
#it's reversed
for i in p:
if i[0] <= x:
res = (i[1] + (x - i[0]) * td).strftime(fmt)
break