Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# initd-example Node init.d
#
# chkconfig: 345 80 20
# description: Node init.d example
# processname: node
# pidfile: /var/run/initd-example.pid
# logfile: /var/log/initd-example.log
#
@twalling
twalling / cgminer.conf
Last active August 23, 2017 06:43
cgminer litecoin setup
{
"pools" : [
{
"url" : "URL",
"user" : "USER.WORKER",
"pass" : "PASS"
}
],
"intensity": "13",
{
"IAB1": "Arts & Entertainment",
"IAB1-1": "Books & Literature",
"IAB1-2": "Celebrity Fan/Gossip",
"IAB1-3": "Fine Art",
"IAB1-4": "Humor",
"IAB1-5": "Movies",
"IAB1-6": "Music",
"IAB1-7": "Television",
"IAB2": "Automotive",
@twalling
twalling / jquery.touch.js
Created October 19, 2012 19:11
Zepto touch for jQuery
;(function($){
var touch = {},
touchTimeout, tapTimeout, swipeTimeout,
longTapDelay = 750, longTapTimeout
function parentIfText(node) {
return 'tagName' in node ? node : node.parentNode
}
function swipeDirection(x1, x2, y1, y2) {
@twalling
twalling / bootstrap.sh
Created September 18, 2012 12:38
Bootstrap bash script which sets environment variables before running a Node.js application
#!/bin/bash
export INSTAGRAM_CLIENTID=INSERT_YOURS_HERE
export INSTAGRAM_CLIENTSECRET=INSERT_YOURS_HERE
export TWITTER_CONSUMERKEY=INSERT_YOURS_HERE
export TWITTER_CONSUMERSECRET=INSERT_YOURS_HERE
export TWITTER_ACCESSTOKENKEY=INSERT_YOURS_HERE
export TWITTER_ACCESSTOKENSECRET=INSERT_YOURS_HERE
node src/workers.js
@twalling
twalling / heroku_syslog_proxy.rb
Created February 26, 2012 04:06
Syslog proxy for Heroku log messages to make them work with Graylog2
# example message:
# 197 <158>1 2011-11-28T19:00:34+00:00 d.b948a827-37d6-431e-9323-03e8ec503a35 heroku router - - GET graylog2.org/images/screenshots/04_t.png dyno=web.1 queue=0 wait=0ms service=4ms status=200 bytes=29494
require 'socket'
require 'gelf'
DEBUG = true
LISTEN_PORT = 5514
LISTEN_ADDRESS = "127.0.0.1"