Skip to content

Instantly share code, notes, and snippets.

View eliukblau's full-sized avatar

Eliuk Blau eliukblau

  • CreepyPanda Software
  • Santiago, Chile
View GitHub Profile
'''
Copyright (c) 2011 Joar Wandborg <http://wandborg.se>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH T
@eliukblau
eliukblau / server.go
Last active August 29, 2015 14:11
Ejemplo de servidor concurrente escrito en Go por Jorge Fuertes
/*
* Small ping-telnet server example
* @2014 Jorge Fuertes - http://jorgefuertes.com
* http://jorgefuertes.com/mi-primer-programa-en-go
*
* Licensed under GPL v3: http://www.gnu.org/licenses/gpl-3.0.txt
*/
package main
@eliukblau
eliukblau / player
Last active August 29, 2015 14:11 — forked from isaiah/player
package main
import (
"bytes"
"code.google.com/p/portaudio-go/portaudio"
"encoding/binary"
"fmt"
"io"
"log"
"os"

Description

When using Homebrew (http://brew.sh) and searching formulas or pull requests you may get the dreaded error message: Github API Rate limit exceeded

Let's fix that! (yeah!)


Short version

Create a new Personal Token in your Github Account Settings (Sidebar: Applications) and then copy the Token. In the Terminal, use export HOMEBREW_GITHUB_API_TOKEN=YOURAPITOKENWITHFUNKYNUMBERSHERE (change that to your API Token) or add that to your .bash_profile and then do source .bash_profile.

# Install Haxe using Brew and set the haxelib path
brew install haxe
haxelib setup /usr/local/Cellar/haxe/lib
# Install lime
haxelib install lime
haxelib run lime setup
# Install lime tools
haxelib install format
@eliukblau
eliukblau / example.go
Created February 9, 2014 07:33 — forked from kavu/example.go
package main
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Cocoa
#import <Cocoa/Cocoa.h>
int
StartApp(void) {
[NSAutoreleasePool new];
lines with $ are commands
### install mkvtoolnix:
$ brew install mkvtoolnix
### list content of the mkv-file:
$ mkvmerge -i mymoviefile.mkv
### what will give you:
## views.py
import tempfile
import os
import commands
import cgi
from django import http
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render
@eliukblau
eliukblau / clausura.vala
Created October 14, 2013 17:31
Implementación en Vala de una clausura simple, con uso de delegados. Las instancias de los métodos delegados conservarán el valor original con el que fueron creados. Ese valor se utilizará para compararlo con el argumento pasado al método delegado. Portado desde ejemplo en original en Perl [ http://es.wikipedia.org/wiki/Clausura_(informática) ]
namespace Clausura {
// 1) declaramos el prototipo del delegado para la clausura
private delegate bool ComparadorMayorQue(int n);
// 2) implementamos metodo que devolvera una funcion delegada
private ComparadorMayorQue crear_funcion_mayor_que(int limite) {
return (val) => { return (val > limite); };
}
public static void main(string args[]) {