Skip to content

Instantly share code, notes, and snippets.

View bastos's full-sized avatar
:shipit:
Shipping something

Tiago Bastos bastos

:shipit:
Shipping something
View GitHub Profile
@bastos
bastos / cm42_dict.md
Last active December 18, 2015 18:29 — forked from edgurgel/cm42_dict.md
  • Brennar:

    • v.t.d. o ato de derrubar, derramar, algo ou alguma coisa sem a intenção do praticante da ação. Isso serve pra qualquer coisa água, almoço (ex. Brennou yourself <- sempre ocorre), café (mais costumeiramente).
  • Joiçar:

    • v.t.i. O ato de ficar até tarde no escritório; ou
    • v.t.i. Ficar mechendo no celular o tempo todo, principalmente em eventos sociais; ou
    • v.t.i. Não tomar café e/ou almoçar; ou
    • v.t.d. Brigar com Mateus porque ele sempre Mateusa (vide Mateusar) com o que eu falo ¬¬
  • Halanzar:

function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo " @" ${ref#refs/heads/}
}
function count_git_changes {
out=$(git status --porcelain 2> /dev/null) || return
git status --porcelain | grep -E "^\ M|\?\?|^ D" | wc -l | awk '{ print " *" $1 " "}'
}
RS Stock No. Qty Description Unit Price Goods Value
756-8308 1 Raspberry Pi Type B Single Board Computer £21.60 £21.60
726-3053 1 Micro USB Euro power supply for Raspberry Pi £4.89 £4.89
2000114151 1 HDMI cable for Raspberry Pi £3.39 £3.39
Running Total £29.88
Standard Delivery (Despatch expected within 5 week(s)) £4.95
Order total
# Debits and credits are a system of notation used in bookkeeping to determine how to record any financial transaction.
class Person
attr_accessor :bookkeeping
end
class BookKeeping
attr_accessor :transactions
end
@bastos
bastos / gist:877172
Created March 19, 2011 02:52
NSNetService test
NSNetService *netService;
netService = [[NSNetService alloc] initWithDomain:@"" type:@"_test._tcp" name:@"Test" port:1234];
[netService setDelegate:self];
[netService publish];
// http://www.student.cs.uwaterloo.ca/~swhitmor/article_metaballs.html
var isofield_width;
var isofield_height;
var isofield_max;
var num_metaballs;
var min_threshold;
var max_threshold;
var isofield = [];// [][]
var metaballs = [];
(function ( $ ) {
var rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;
$.mobile.page.prototype.options.cache = true;
$( ":mobile-page" )
.live( "pagebeforecreate", function() {
var page = $( this ).data( "page" ),
cache = page.options.cache;
// WTF?
page.url = page.options.url;
if ( cache === true ) {
@bastos
bastos / oo.php
Created September 22, 2010 19:54 — forked from dhotson/oo.php
<?php
// Define the 'class' class
$class = Obj()
->fn('new', function ($class) {
$newClass = Obj($class->methods)
->fn('new', function($class) {
$obj = Obj($class->imethods);
$args = func_get_args();
array_shift($args);
import java.awt.AWTException;
import java.awt.MenuItem;
import java.awt.PopupMenu;
import java.awt.SystemTray;
import java.awt.TrayIcon;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
@bastos
bastos / gist:429868
Created June 8, 2010 11:00
First lines of OCaml
let rec find needle l =
match l with
[] -> false
| hd :: tl ->
if hd = needle then true
else find needle tl;;
Printf.printf "Result = %b\n" (find 100 [10;1;2;3;4])