Skip to content

Instantly share code, notes, and snippets.

View cesarblum's full-sized avatar

Cesar Blum cesarblum

  • Microsoft
  • Seattle, WA
  • 02:45 (UTC -07:00)
View GitHub Profile

Keybase proof

I hereby claim:

  • I am cesarblum on github.
  • I am cblum (https://keybase.io/cblum) on keybase.
  • I have a public key whose fingerprint is 02B5 72E4 5B1D D1B7 95E6 67D0 2B73 5260 B6FE CB84

To claim this, I am signing this object:

@cesarblum
cesarblum / I hate Macs
Created July 18, 2016 19:01
I hate Macs
$ sudo scutil --get ComputerName
Cesar's MacBook Air
$ sudo scutil --get LocalHostName
Cesars-MacBook-Air
$ sudo scutil --get HostName
Alaska
@cesarblum
cesarblum / gist:2011279
Created March 10, 2012 12:17
TinyWM in Chicken Scheme
;; TinyWM is written by Nick Welch <mack@incise.org>, 2005.
;; Ported to Chicken by César L. B. Silveira <cesarbs@gmail.com>, 2011.
;;
;; Original TinyWM website: http://incise.org/tinywm.html
;;
;; This software is in the public domain
;; and is provided AS IS, with NO WARRANTY.
(require-extension xlib)
@cesarblum
cesarblum / gist:1909485
Created February 25, 2012 16:50
Print numbers from 1 to 1000 without a loop
#include <iostream>
template <int N> struct P
{
P()
{
P<N - 1>();
std::cout << N << std::endl;
}
};
@cesarblum
cesarblum / gist:1376411
Created November 18, 2011 13:04
Nondeterministic finite automaton implementation in 2 lines of Prolog
% Nondeterministic finite automaton implementation
%
% Author: Cesar L. B. Silveira <cesarbs@gmail.com>
%
% This is public domain code.
%
% Usage:
%
% nfa(INPUT_STRING, DESCRIPTION, INITIAL_STATE, FINAL_STATES).
%
@cesarblum
cesarblum / unshredder.py
Created November 13, 2011 23:00
Solution to Instagram Engineering Challenge: The Unshredder
import PIL.Image
import sys
def stitching(image, shred_width, left_shred, right_shred):
"""Calculate the cost of stitching two shreds.
Arguments:
image -- grayscale image
shred_width -- width of a shred
left_shred -- index of the left shred