Skip to content

Instantly share code, notes, and snippets.

View f3nry's full-sized avatar

Paul Henry f3nry

  • Coinbase
  • Oakland, CA
View GitHub Profile
@f3nry
f3nry / session.scala
Created September 19, 2012 06:22
Square Roots in Scala
object session {
def sqrt(x: Double) = {
def abs(x: Double) = if (x < 0) -x else x
def sqrtIter(guess: Double): Double =
if(isGoodEnough(guess)) guess
else sqrtIter(improve(guess))
def isGoodEnough(guess: Double): Boolean =
@f3nry
f3nry / gist:3729184
Created September 15, 2012 18:27
Hearts
# encoding: utf-8
❤ = ["Person1", "Person2", "Person3"]
for person in ❤
puts person
end
@f3nry
f3nry / really.js
Created September 7, 2012 06:14
Valid Javascript...?
[][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]][([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]]+[])[+[[!+[]+!+[]+!+[]]]]+([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]]]+([][[]]+[])[+[[+!+[]]]]+(![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[+!+[]]]]+([][[]]+[])[+[[+[]]]]+([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[
@f3nry
f3nry / hello.cpp
Created August 30, 2012 03:43
C++ Web Application
#include "cppcms/application.h"
#include "cppcms/applications_pool.h"
#include "cppcms/service.h"
#include "cppcms/http_response.h"
#include <cppcms/url_dispatcher.h>
#include <cppcms/url_mapper.h>
#include <iostream>
#include "content.h"
@f3nry
f3nry / mostusedcommands
Created December 31, 2011 19:55
most used commands
history | awk '{print $2}' | awk 'BEGIN {FS="|"} {print $1}' | sort | uniq -c | sort -r
148 git
51 cd
39 ls
32 scala
32 rails
27 rspec
25 vagrant
15 vim