Skip to content

Instantly share code, notes, and snippets.

package com.geleca.as3.loading
{
import com.geleca.as3.net.SimpleNetStream;
import com.geleca.as3.util.SimpleTimer;
import flash.events.Event;
import flash.events.TimerEvent;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.utils.Timer;
package com.geleca.as3.loading
{
import com.geleca.as3.net.SimpleNetStream;
import com.geleca.as3.util.SimpleTimer;
import flash.events.Event;
import flash.events.TimerEvent;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.utils.Timer;
@cccaldas
cccaldas / man-to-pdf
Created December 11, 2011 20:32
Bash Man to PDF for Mac
#!/bin/bash
man -t $1 > $2.ps
/System/Library/Printers/Libraries/convert -f $2.ps -o $2
rm $2.ps
#usage example: ./man-to-pdf git ~/Desktop/git.pdf
@cccaldas
cccaldas / git-clone-branch
Created December 20, 2011 11:03
git-clone-branch
#file: git-clone-branch
mkdir $3
cd $3
git init
echo "readme" > README
git add README
git commit -m "first commit"
git branch $2
git checkout $2
@cccaldas
cccaldas / gist:1555516
Created January 3, 2012 16:06
assembly hello world
; Hello World in assembly for mac
; nasm -f macho hello.asm
; ld -e _start -o hello hello.o
;
section .text
global _start ;must be declared for linker (ld)
_syscall:
int 0x80 ;system call
ret
@cccaldas
cccaldas / gist:1688710
Created January 27, 2012 13:13
js oop
//oop
Function.prototype.extends = function(parentClassOrObject){
if(parentClassOrObject.constructor == Function)
{
//normal inheritance
this.prototype = new parentClassOrObject;
this.prototype.constructor = this;
this.prototype.super = parentClassOrObject.prototype;
}
#content: '-(void)executeCommand:(NSString *)name waitFinish:(BOOL)waitFinish;'
item = item.gsub!(/-\(.*\)/, "") #removing return types
#expected: executeCommand:(NSString *)name waitFinish:(BOOL)waitFinish
#returning: waitFinish;
@cccaldas
cccaldas / gist:1925997
Created February 27, 2012 18:28
json itamaraty
[
{ "id": "1",
"nome": "Confraterniza\u00e7\u00e3o 1",
"responsavel": "Ana Luiza 1",
"local":"Itamaraty Hall",
"saloes":"Foyer Água Marina, Foyer Turquesa",
"data":"2012-02-06",
"inicio":"14h",
"termino":"17h",
"convidados": [
[
{ "id": "1",
"nome": "Confraterniza\u00e7\u00e3o 1",
"responsavel": "Ana Luiza 1",
"local":"Itamaraty Hall",
"saloes":"Foyer Água Marina, Foyer Turquesa",
"data":"2012-02-06",
"inicio":"14h",
"termino":"17h",
"convidados": [
@cccaldas
cccaldas / gist:1934624
Created February 28, 2012 19:39
Formato de Importação
[
{ "id": "1",
"id_tipo_servico": "1",
"nome": "Confraterniza\u00e7\u00e3o 1",
"responsavel": "Ana Luiza 1",
"local":"Itamaraty Hall",
"saloes":"Foyer Água Marina, Foyer Turquesa",
"data":"2012-02-06",
"inicio":"14h",
"termino":"17h",