Skip to content

Instantly share code, notes, and snippets.

CL-USER> (defvar Hͫ̆̒̐ͣ̊̄ͯ͗͏̵̗̻̰̠̬͝ͅE̴̷̬͎̱̘͇͍̾ͦ͊͒͊̓̓̐_̫̠̱̩̭̤͈̑̎̋ͮͩ̒͑̾͋͘Ç̳͕̯̭̱̲̣̠̜͋̍O̴̦̗̯̹̼ͭ̐ͨ̊̈͘͠M̶̝̠̭̭̤̻͓͑̓̊ͣͤ̎͟͠E̢̞̮̹͍̞̳̣ͣͪ͐̈T̡̯̳̭̜̠͕͌̈́̽̿ͤ̿̅̑Ḧ̱̱̺̰̳̹̘̰́̏ͪ̂̽͂̀͠ "ZALGO")
Hͫ̆̒̐ͣ̊̄ͯ͗͏̵̗̻̰̠̬͝ͅE̴̷̬͎̱̘͇͍̾ͦ͊͒͊̓̓̐_̫̠̱̩̭̤͈̑̎̋ͮͩ̒͑̾͋͘Ç̳͕̯̭̱̲̣̠̜͋̍O̴̦̗̯̹̼ͭ̐ͨ̊̈͘͠M̶̝̠̭̭̤̻͓͑̓̊ͣͤ̎͟͠E̢̞̮̹͍̞̳̣ͣͪ͐̈T̡̯̳̭̜̠͕͌̈́̽̿ͤ̿̅̑Ḧ̱̱̺̰̳̹̘̰́̏ͪ̂̽͂̀͠
CL-USER> Hͫ̆̒̐ͣ̊̄ͯ͗͏̵̗̻̰̠̬͝ͅE̴̷̬͎̱̘͇͍̾ͦ͊͒͊̓̓̐_̫̠̱̩̭̤͈̑̎̋ͮͩ̒͑̾͋͘Ç̳͕̯̭̱̲̣̠̜͋̍O̴̦̗̯̹̼ͭ̐ͨ̊̈͘͠M̶̝̠̭̭̤̻͓͑̓̊ͣͤ̎͟͠E̢̞̮̹͍̞̳̣ͣͪ͐̈T̡̯̳̭̜̠͕͌̈́̽̿ͤ̿̅̑Ḧ̱̱̺̰̳̹̘̰́̏ͪ̂̽͂̀͠
"ZALGO"
@voidlily
voidlily / client.c
Last active October 2, 2015 10:18
pubsub logger
#include <zmq.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define SOCKET_ADDR "ipc:///tmp/logger"
// source: http://stackoverflow.com/questions/122616/how-do-i-trim-leading-trailing-whitespace-in-a-standard-way
@voidlily
voidlily / client.c
Last active October 2, 2015 10:27
pubsub logger with forwarder
#include <zmq.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define SOCKET_ADDR "ipc:///tmp/logging"
// source: http://stackoverflow.com/questions/122616/how-do-i-trim-leading-trailing-whitespace-in-a-standard-way
@voidlily
voidlily / lambdas.rb
Last active October 4, 2015 04:38
lambdas
l = lambda { |x| x + 5 }
l(3) # doesn't work
l.call(3) # works
l[3] # works
foo = lambda do |a|
b = a + 5
b
end
b = 2
foo.call(b)
=> 7
b
source 'http://rubygems.org'
gem 'sequel'
gem 'rspec'
gem 'sqlite3'
# Sinatra
error 404 do
"WHAT THE HELL DID YOU DO [PERSON'S NAME HERE]?? YOU BROKE IT, PEOPLE ARE DYING, WHYY"
end
# incorrect
time = Time.zone.parse('2011-11-06T01:00:00')
=> Sun, 06 Nov 2011 01:00:00 PDT -07:00
time.advance(hours: 1).beginning_of_hour
=> Sun, 06 Nov 2011 01:00:00 PDT -07:00
# correct usage
time.utc.advance(hours: 1).change(min: 0).in_time_zone
(defn rent [initial year]
"Calculates the rent for a given year. Assumes 1.9% increase yearly based on SF rent control."
(* initial (Math/pow 1.019 year)))
(defn rent-seq [price]
"Generates a lazy infinite sequence of rent increases based on a given base price."
(map #(rent price %) (iterate inc 0)))
; Get the projected rent increases for living at a place for 10 years
(->> (rent-seq 2000) (take 10) (map #(format "%.2f" %)))

Keybase proof

I hereby claim:

  • I am voidlily on github.
  • I am voidlily (https://keybase.io/voidlily) on keybase.
  • I have a public key whose fingerprint is BBF4 6311 39A1 AE78 5DF8 784F 10D8 CF3B 5F7E EB02

To claim this, I am signing this object: