Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am gbenatti on github.
  • I am gbenatti (https://keybase.io/gbenatti) on keybase.
  • I have a public key whose fingerprint is E11B 16F0 2F41 9B3F 255F A24A FCA2 068D C0A9 C5BC

To claim this, I am signing this object:

@gbenatti
gbenatti / gist:7794741
Created December 4, 2013 20:16
Coversor de csv do aapg para o yaml do mcp
using System;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
namespace aapg2mcp
{
class MainClass
{
public static void Main (string[] args)
@gbenatti
gbenatti / gist:7791009
Last active December 30, 2015 06:39
Parser das permissoes do aapg, feito em F#
module ParseAapgPermissions.Main
open System
open System.IO
open System.Text.RegularExpressions
let lineSequence(file) =
let reader = File.OpenText(file)
Seq.unfold(fun line ->
if line = null then
@gbenatti
gbenatti / gist:6498776
Created September 9, 2013 17:23
Loop unrolling on Ruby2600 Tia.rb
def draw_scanline
scanline = Array.new(160, 0)
unroll_count = 16
loop_count = VISIBLE_CLK_COUNT/unroll_count
pixel = 0
while loop_count > 0
draw_pixel(pixel, scanline)
draw_pixel(pixel+1, scanline)
@gbenatti
gbenatti / gist:1002945
Created June 1, 2011 18:27
Problemas com herança
using System;
namespace heir
{
interface IBasicController
{
}
interface ILoadController : IBasicController
{
@gbenatti
gbenatti / gist:874723
Created March 17, 2011 17:13
deffered boo macro
namespace UnityScript.Macros
import Boo.Lang.Compiler.Ast
macro deferred:
case [| deferred $(ReferenceExpression(Name: name)) = $initializer |]:
p = Property(Name: name)
p.Getter = [|
[Boo.Lang.Useful.Attributes.OnceAttribute]
def get():
@gbenatti
gbenatti / assign.boo
Created February 9, 2011 20:08 — forked from bamboo/assign.boo
import System
import Boo.Lang.Compiler
import Boo.Lang.Compiler.Ast
import Boo.Lang.Compiler.Services
import Boo.Lang.Environments
import Boo.Lang.Compiler.MetaProgramming
[meta]
def assign(e as MethodInvocationExpression):
"""
#!/bin/sh
export PATH="/Library/Frameworks/Mono.framework/Versions/Current/bin:$PATH"
export PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig:/Library/Frameworks/Mono.framework/Home/lib/pkgconfig:/usr/lib/pkgconfig:/opt/local/lib/pkgconfig
pushd $HOME/Projects/third-party/boo
for m in Boo.Lang Boo.Lang.Compiler Boo.Lang.CodeDom Boo.Lang.Parser Boo.Lang.Useful Boo.Lang.Interpreter Boo.Lang.Extensions; do sudo /Library/Frameworks/Mono.framework/Home/bin/gacutil /u $m; done
alias nant=/Library/Frameworks/Mono.framework/Home/bin/nant
nant rebuild update-bin && nant make-bin-dist && tar xzvf boo-* && cd boo-* && ./configure --prefix=/Library/Frameworks/Mono.framework/Home --libdir=/Library/Frameworks/Mono.framework/Home/lib && make && sudo
sudo make install && cd .. && rm -fr boo-*