Skip to content

Instantly share code, notes, and snippets.

View sescobb27's full-sized avatar
🇨🇴
sisas parce

Simon Escobar Benitez sescobb27

🇨🇴
sisas parce
View GitHub Profile
@rustyio
rustyio / gproc_tests.erl
Created September 16, 2009 13:16
gproc_tests.erl
-module(gproc_tests).
-compile(export_all).
-include_lib("stdlib/include/qlc.hrl").
go() -> make:all([load]).
register_stuff() ->
gproc:reg({n, l, key1}, value1),
gproc:reg({n, l, key2}, value2),
gproc:reg({n, l, key3}, value3),
@chrisroos
chrisroos / gpg-import-and-export-instructions.md
Created September 9, 2011 10:49
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@mojodna
mojodna / Procfile
Created September 29, 2011 20:22 — forked from RandomEtc/Procfile
Getting Kue working on Heroku
web: node app.js
worker: node consumer.js
@vasilisvg
vasilisvg / HTML-presentation-tools.md
Created January 14, 2012 13:53
HTML presentation tools

#HTML presentation tools

There are many HTML presentation tools and they are all created for slightly different reasons. Here's an overview. Please let me know if I forgot any.

##CSSS

CSS-based SlideShow System

@the42
the42 / gist:1956518
Created March 2, 2012 07:34
GZip encoding for GO V1 using custom responsewriter
package main
import (
"compress/gzip"
"io"
"net/http"
"strings"
)
type gzipResponseWriter struct {
@Capncavedan
Capncavedan / Ruby script
Created April 9, 2012 15:45
Ruby script to show OS X battery info at command line
#!/usr/bin/ruby
ioreg_data = IO.popen("ioreg -w0 -l").readlines().join
ioreg_data.sub!(/.*(\+\-o AppleSmartBattery.*?\+\-o).*/m, '\\1')
ioreg_data.gsub!(/\s+\|/, "")
ioreg_data.gsub!(/\s\s+/, "\n")
battery = Hash.new
ioreg_data.split(/\n+/).each do |line|
key, value = line.split(' = ')[0..1]
next if key.nil? || value.nil?
@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@dnishimura
dnishimura / Makefile.golang
Created June 20, 2012 17:51 — forked from yanatan16/Makefile.golang
Makefile for Golang projects
# Makefile for a go project
#
# Author: Jon Eisen
# site: joneisen.me
#
# Targets:
# all: Builds the code
# build: Builds the code
# fmt: Formats the source files
# clean: cleans the code
@briancavalier
briancavalier / promise-monad-proof.js
Created August 8, 2012 15:57
A proof that Promises/A is a Monad
//-------------------------------------------------------------
//
// Hypothesis:
//
// Promises/A is a Monad
//
// To be a Monad, it must provide at least:
// - A unit (aka return or mreturn) operation that creates a corresponding
// monadic value from a non-monadic value.
// - A bind operation that applies a function to a monadic value
@border
border / long_polling.go
Created September 25, 2012 09:58
long polling for golang
package main
import (
"container/list"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"