Skip to content

Instantly share code, notes, and snippets.

View augustohp's full-sized avatar

Augusto Pascutti augustohp

View GitHub Profile
@henriquemoody
henriquemoody / ArgoUML.sh
Created August 15, 2012 19:22
Install ArgoUML on linux
#!/bin/sh
if [ "root" != "$(whoami)" ]; then
echo "You must run this command as root" 1>&2
exit 1
fi
set -x
# Download and extract
if [ ! -z "${1}" ]; then
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
@alganet
alganet / transform.php
Created May 20, 2012 15:15
Respect\Transform transforms data friendly to the web
<?php
use Respect\Transform\Transformer as t;
$users = array(
array("id" => 1, "first_name" => "Alexandre", "last_name" => "Silva", "location" => "São Paulo"),
array("id" => 2, "first_name" => "Satoshi", "last_name" => "Silva", "location" => "Curitiba"),
array("id" => 3, "first_name" => "Fulano", "last_name" => "Silva", "location" => "New York")
);
@henriquemoody
henriquemoody / recterm.sh
Created May 8, 2012 21:41
Record the terminal session and replay later
#!/bin/bash
# Uses script and scriptreplay to record and playback virtual terminal.
# Copyright (C) 2007 Hean Kuan Ong <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@jdp
jdp / bf2c.py
Created March 29, 2012 14:20
Naive brainfuck-to-C compiler
#!/usr/bin/env python
import argparse
import sys
def tokenize(source):
return list(source)
def parse(tokens):
@alganet
alganet / mocks.php
Created March 27, 2012 17:22
Next-gen mocks and stubs for PHP 5.4
<?php
use FooBar\Test\Mock;
// In the sample below, $mock expects the method "sayHelloTo" to be called one time
// with the parameter $name equals "Alexandre" and return "Hello Alexandre"
$mock = (new Mock('NamespaceVendor\\ClassName'))([
'sayHelloTo' => function($name="Alexandre") {
return "Hello Alexandre";
git remote add --track master upstream git://github.com/upstreamname/projectname.git
@alganet
alganet / h.php
Created August 10, 2011 22:43
HTML generator prototype
<?php
print
h::html(
h::head(
h::title('Hi!')
),
h::body(
h::h1('Hello')->id('oi'),
h::ul(