Skip to content

Instantly share code, notes, and snippets.

View sandinmyjoints's full-sized avatar
🏠
Working from home

William Bert sandinmyjoints

🏠
Working from home
View GitHub Profile
@sandinmyjoints
sandinmyjoints / control-madness.js
Created May 30, 2014 18:05
Control character causes socket hang up
var http = require("http");
var query = 'ningun';
http.get("http://127.0.0.1:2000/api/v1/dictionary?q=" + query + "&source=en", function(res) {
res.setEncoding('utf8');
var content = '';
res.on('data', function (chunk) {
console.log("res.on data");
content += chunk;
@sandinmyjoints
sandinmyjoints / public.md
Created October 15, 2014 21:32
public md

title

  • a
  • b
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@sandinmyjoints
sandinmyjoints / init.el
Created September 18, 2012 15:55
Emacs init.el
;; -*- lexical-binding: t -*-
;;;; init.el
;;;; See: https://gist.github.com/3743892
;;; TODO:
;;; * Coffee-script etags.
;;; * Coffee-script compile and flymake.
;;; * swank.js:
;;; * https://github.com/Gozala/swank-js
@sandinmyjoints
sandinmyjoints / hack.sh
Created September 28, 2012 00:56 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@sandinmyjoints
sandinmyjoints / index.js
Created October 26, 2015 22:26
simple node server
var http = require('http');
function respond (req, res) {
console.log('request: ' + req.url);
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}
http.createServer(respond).listen(1025, '0.0.0.0');
console.log('Server running at http://0.0.0.0:1025');
#!/bin/bash
# Author:
# Email:
# Date: yyyy-mm-dd
# Usage: script.sh [-a|--alpha] [-b=val|--beta=val]
# Description:
#
#
#
@sandinmyjoints
sandinmyjoints / md.py
Created May 12, 2013 19:20
Quick and dirty Markdown script.
import sys
import markdown
USAGE = "%s <file.md> <css dir>" % __file__
TAIL = """
</body>
</html>
"""
# $ brew install https://raw.github.com/gist/1121425/rubberband.rb
require 'formula'
class Rubberband < Formula
homepage ''
url 'http://code.breakfastquay.com/attachments/download/35/rubberband-1.8.1-gpl-executable-osx-universal.tar.bz2'
version '1.8.1'
sha1 'bceba7dba8cdd773a318ca973ed9c5806be03262'
# Helpers.
_mp = ->
window.mixpanel ? null
redirect = ->
_redirect = ->
window.location.href = "#{host}/#users/new-profile"
null
# A little delay to ensure MP events are all sent. Setting this to 50 ms