Skip to content

Instantly share code, notes, and snippets.

View nalanj's full-sized avatar
🌴
On vacation

nalanj nalanj

🌴
On vacation
View GitHub Profile
@nalanj
nalanj / libgit2.rb
Created May 10, 2016 02:32
Homebrew formula for libgit2
class Libgit2 < Formula
desc "C library of Git core methods that is re-entrant and linkable"
homepage "https://libgit2.github.com/"
url "https://github.com/libgit2/libgit2/archive/v0.24.1.tar.gz"
sha256 "2d201fe3f76758043ce78c7bb9cf7deb4f0b547bdb323e1915d0d104aa0bb03c"
head "https://github.com/libgit2/libgit2.git"
option :universal
depends_on "pkg-config" => :build
@nalanj
nalanj / group_by_user_and_month.sql
Last active August 29, 2015 14:22
Invoice Analysis
SELECT user_id, to_char(date, 'YYYY-MM') AS month, SUM(amount) as total
FROM invoices
GROUP BY user_id, month
ORDER BY user_id, month;
@nalanj
nalanj / bayesian.rb
Created November 2, 2014 21:29
Bayesian experiment comparison
require 'distribution'
# set these values
control_success = 338
control_fail = 56
experiment_success = 341
experiment_fail = 53
alpha_a = control_success + 1
beta_a = control_fail + 1
@nalanj
nalanj / instapaper-import.rb
Created September 11, 2014 15:13
Instapaper to Reading List
require 'csv'
urls = []
CSV.foreach("instapaper-export.csv") do |row|
urls << row[0]
end
urls.reverse.each do |url|
puts "Adding: #{url}"
`osascript -e 'tell application "Safari"' -e 'add reading list item "#{url}"' -e 'end tell'`
@nalanj
nalanj / command_line.rb
Created August 24, 2014 16:58
Radicle Command Line
#
# This was the command line implementation for Radicle. It's no longer in use, but I thought it was worthwhile
# to keep around, just in case.
#
require "optparse"
module Radicle
class CommandLine
# Public: Parses a command line array and returns a hash
@nalanj
nalanj / tacoish.md
Created December 17, 2013 05:01
Turkey Tacoish Soup This was what I made with my Thanksgiving turkey leftovers and carcass this year.

Turkey Tacoish Soup

Serves 8

Ingredients

  • Leftover Turkey Carcass and Bones
  • 3 Carrots, chopped roughly
  • 1/2 Onion, chopped roughly
  • 6 Cloves Garlic, peeled
@nalanj
nalanj / kalbi.md
Last active December 31, 2015 11:09
Kalbi - Korean Short Ribs

Kalbi - Korean Short Ribs

Serves 4

Ingredients

  • 2 lbs. Short Ribs, cut flanken style
  • 2 Tbsp. Sugar
  • 1.5 Cups Soy Sauce
  • 2 Tbsp. Sesame Oil
@nalanj
nalanj / theme.html
Created July 22, 2012 02:04
My Tumblr Theme
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- Based on langer.tumblr by langer, http://blog.mattlanger.com/, with some extra customizations by me,
commondream -->
<title>{Title}{block:PostTitle} - {PostTitle}{/block:PostTitle}</title>
<link rel="icon" href="{Favicon}"/>
<link rel="alternate" type="application/rss+xml" title="RSS" href="{RSS}"/>
<meta name="viewport" content="width=775"/> <!-- iPhone -->
class NavLabels
constructor: () ->
mouseIn = () ->
$(this).find(".nav-label-container").animate {
opacity: 1
top: 45
}, 400
mouseOut = () ->
class NavLabels
constructor: () ->
mouseIn = () ->
$(this).animate({
opacity: 1
top: 45
}, 400)
mouseOut = () ->
$(this).animate({
opacity: 0