Skip to content

Instantly share code, notes, and snippets.

View pcalcado's full-sized avatar

Phil Calçado pcalcado

View GitHub Profile
@pcalcado
pcalcado / gist:7e684f7a5ae5a31c7de8
Last active October 1, 2015 13:13
Backlog for philcalcado.com
Please write a comment with the order you'd prioritise these (and any suggestions or comments)
or tweet to @pcalcado. <3
1. Why we moved from HTTP to Thrift(mux) in internal services
2. Moving from a one-size-fits-all API to one-api-per-client-application and
its implications in a microservices archtiecture
3. We we moved on from numeric IDs to URNs and how do we manage object
lifecycle in microservices architecture
@pcalcado
pcalcado / robot.js
Created December 4, 2012 19:12 — forked from kamuflage661/robot.js
GACEK
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
//robot.clone();
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
//robot.rotateCannon(90)
@pcalcado
pcalcado / robot.js
Created December 3, 2012 10:05 — forked from victorlcampos/robot.js
Bartorista
function Robot(robot) {}
// well, we need to do something...
// whenever our robot is idle, this method gets called.
Robot.prototype.onIdle = function(ev) {
var robot;
robot = ev.robot;
robot.ahead(50);
robot.turn(90);
robot.rotateCannon(10);
robot.rotateCannon(-20);
@pcalcado
pcalcado / gist:2500286
Created April 26, 2012 15:14
pre checkin for legacy/slow rails apps
#!/bin/bash
function specs_to_run(){
git status | grep rb$ | awk '{print $3}' | sed -e "s/^[a-z][a-z]*/spec/g" | sed -e "s/[a-z_]*.rb$/\*/g" | sort | uniq
}
echo "Need to run these before checking-in:"
specs_to_run
bundle exec spec `specs_to_run | xargs -L 1000 echo`
@pcalcado
pcalcado / gist:1688957
Created January 27, 2012 14:12
Genetic Algorithms, Videos and VBScript
Posted on January 22, 2009 by admin
Carlo "Zed" Caputo already commented on the use of Genetic Algorithms
to improve the quality of the videos here on globo.com, work that
yields good results when searching for profiles that combine size,
quality and encoding time. When working with H.264 profiles we
discovered an interesting thing: Not all profiles played on the
iPhone. There was apparently no rule to generate a "universal"
profile, so some more "hardcore" testing procedure was required:
@pcalcado
pcalcado / gist:1507722
Created December 21, 2011 21:11
ruby is inconsistent
#given
def store_for_later(something_i_can_invoke)
@something_i_can_invoke = something_i_can_invoke
end
#i want
SomeCommonCode = lambda { :bazinga }
store_for_later(SomeCommonCode)
@something_i_can_invoke.call
@pcalcado
pcalcado / Ableitung der y-Kombinator.clj
Created April 6, 2011 23:21
Ableitung der y-Kombinator
;Ableitung der y-Kombinator
(use 'midje.sweet)
(fact "direkte Rekursion"
(defn fakultät [n]
(if (> 2 n)
1
(* n (fakultät (dec n)))))
(fakultät 5) => 120)
class OrderRepository {
List<Order> getOrdersFor(Account a){...}
}

I've finally moved my blog to a static website -using nanoc and nanoc_blog. Old URLs should still work but the files were extracted with wget from the previous Wordpress setup; they should be considered legacy pages. At some point I will convert the most acessed content to the new format, hopefully.

If you are new here and looking for something specific here is a list with some recent posts from the old blog: