Skip to content

Instantly share code, notes, and snippets.

View metakeule's full-sized avatar
💭
I may be slow to respond.

metakeule metakeule

💭
I may be slow to respond.
  • Asunción / Paraguay
View GitHub Profile
@metakeule
metakeule / index.html
Created May 19, 2014 23:10
A Pen by Secret Sam.
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
<!-- Latest compiled and minified CSS -->
@metakeule
metakeule / main.go
Created January 14, 2015 11:18
benchmark error loops
package main
import (
"errors"
)
var Err = errors.New("test err")
func addOne(y, x int) (int, error) {
if x%y == 0 {
@metakeule
metakeule / errloop.sublime-snippet
Created January 14, 2015 11:22
snippet for error loop, put it somewhere beneath ~/.config/sublime-text-3/Packages/User
<snippet>
<content><![CDATA[
var (
// define the variables here that are shared along the steps
// most variables should only by defined by the type here
// and are assigned inside the steps
err error
${1:}
)
@metakeule
metakeule / main.go
Created January 20, 2015 10:10
simple example how to use azul3d.org/audio
// simple example how to use azul3d.org/audio
//
// run it with SoX
// go run main.go | play -
//
// or save it to a file
// go run main.go > test.wav
//
package main
@metakeule
metakeule / sublime_wrapper.sh
Created February 29, 2012 10:55
here a simple wrapper script to start sublime text 2 and include environment variables under ubuntu
#!/bin/bash
# make it executable and symlink /usr/bin/subl to it
# don't source .bashrc since it won't work (I guess it makes sure it's only source once in the system)
source /home/yourname/.bash_env # put your env variables into this file and source it in .bashrc too, if you need them somewhere else
exec "$(dirname "$(readlink -f "$0")")/sublime_text";
@metakeule
metakeule / gist:2020946
Created March 12, 2012 09:41
install nvm and node.js on ubuntu
sudo apt-get install build-essential libssl-dev curl git-core
git clone git://github.com/creationix/nvm.git ~/.nvm
echo "\n. ~/.nvm/nvm.sh" >> .bashrc
bash
nvm install v0.6.11
nvm alias default 0.6
@metakeule
metakeule / Vagrantfile
Created March 13, 2012 17:57
Vagrant configuration
##################################
### Custom additions from Krux
##################################
### Extensive documentation here:
### http://vagrantup.com/docs/vagrantfile.html
require 'etc'
owner = ENV['KRUX_MY_USERNAME'] || Etc.getlogin
hosts = {
@metakeule
metakeule / monitrc
Created March 14, 2012 13:21
node app as daemon with nvm, upstart and monit
# /etc/monit/monitrc (excerpt)
check process node-app with pidfile /var/run/node-app.pid
start program = "/sbin/start node-app" with timeout 5 seconds
stop program = "/sbin/stop node-app"
if failed port 3000 protocol HTTP
request /
with timeout 3 seconds
then restart
if cpu > 80% for 10 cycles then restart
@metakeule
metakeule / observer.md
Created May 10, 2012 13:24 — forked from lloyd/observer.md
BrowserID Observer API

BrowserID "Observer" API

The BrowserID JavaScript API can be used by web pages to implement BrowserID authentication. Implementing BrowserID support consists of:

  1. registering callback functions that will be invoked when the user logs in or out via navigator.id.watch()
  2. invoking navigator.id.request() when the user clicks a login button on your site.
  3. invoking navigator.id.logout() when the user clicks a logout button on your site.
@metakeule
metakeule / gist:2803223
Created May 27, 2012 10:32
clone an heroku app on a linux machine
# install git
# setup your global git config
# then generate a public key with ssh-keygen
# setup and install your ruby and gems
gem install foreman
gem install heroku
heroku login
heroku keys:add
git clone git@heroku.com:your-app.git