Skip to content

Instantly share code, notes, and snippets.

@npiv
npiv / gist:2027342
Created March 13, 2012 06:59
Coursera course downloader
#-------------------------------------------------------------------------------
# Name: Coursera_downloader
# Purpose: downloader for coursera design and analysis of algorythms lecture. Requires python 2.7
#
# Author: Alder
#
# Created: 11/03/2012
# Copyright: (c) Alder 2012
# Licence: free
#-------------------------------------------------------------------------------
@npiv
npiv / poundcontroller.rb
Created March 16, 2012 19:16
pound persisted
class PoundController < ApplicationController
def r
end
def start
redirect_to "/pound/r"
end
end
@npiv
npiv / go.sh
Created October 20, 2012 05:32
install my dots
cd ~
git clone git://github.com/nickv82/dots.git dots
cd dots
sh setup.sh
@npiv
npiv / Unicorn.java
Created February 19, 2013 14:27
unicorns
public class Unicorn {
static {
Field field;
try {
field = Math.class.getDeclaredField("randomNumberGenerator");
field.setAccessible(true);
field.set(null, new Random() {
@Override
public double nextDouble() {
@npiv
npiv / gist:7510824
Created November 17, 2013 08:28
osx crash dota2
Process: dota_osx [4140]
Path: /Users/USER/Library/Application Support/Steam/*/dota_osx
Identifier: dota_osx
Version: ???
Code Type: X86 (Native)
Parent Process: bash [4137]
Responsible: bash [1870]
User ID: 501
Date/Time: 2013-11-17 01:11:59.185 +0000
r.db(dbName).table(tableName).filter(new DBLambda() {
@Override
public RTFluentRow apply(RTFluentRow row) {
return row.or(
row.and(
row.field("age").gt(20),
row.field("age").lt(30)
),
row.field("name").eq("heman")
);
@npiv
npiv / fit.csv
Created September 19, 2014 12:50
Date Exercise Category Weight (kgs) Reps Distance Distance Unit Time
2014-08-03 Flat Barbell Bench Press Chest 45.0 12
2014-08-03 Flat Barbell Bench Press Chest 45.0 10
2014-08-03 Flat Barbell Bench Press Chest 60.0 8
2014-08-03 Flat Barbell Bench Press Chest 70.0 6
2014-08-03 Flat Barbell Bench Press Chest 70.0 6
2014-08-03 Flat Barbell Bench Press Chest 75.0 6
2014-08-03 Incline Dumbbell Bench Press Chest 50.0 6
2014-08-03 Incline Dumbbell Bench Press Chest 60.0 6
2014-08-03 Incline Dumbbell Bench Press Chest 60.0 5
(function() {
// window on the browser, exports on the server
var root = this;
// the Cards module
var Cards = root.Cards = {};
// utility functions
var util = Cards.util = {
bitwiseAnd : function(a, b) { return a & b; },
{"6d8c6s":0.9111111111111111,"QhTc9s":0.2106060606060606,"QcKc9s":0.356060606060606,"9h2d8c":0.36616161616161613,"8d4c2s":0.23333333333333336,"5c2sKs":0.0984848484848485,"8hAhAs":0.0,"Td3cTc":0.30606060606060603,"Qd4sAs":0.03232323232323232,"KhQdAc":0.03585858585858586,"3hAh7s":0.01717171717171717,"6hAh2d":0.00101010101010101,"9hQh5c":0.22777777777777777,"Ah3sKs":0.015488215488215488,"3d4d5s":0.9446969696969697,"TdKd7s":0.19141414141414145,"4h8cQc":0.45303030303030306,"Jd5c3s":0.23333333333333336,"3s6sJs":0.17095959595959595,"QdTcJs":0.06641414141414141,"Tc3s6s":0.24949494949494952,"Jc9sAs":0.058585858585858595,"3d4c3s":0.18383838383838383,"6hTcAc":0.2919191919191919,"4h8cJs":0.23333333333333336,"5d9sQs":0.19747474747474747,"5d5c9c":0.39797979797979804,"7dJcQc":0.47020202020202023,"6hAdTs":0.01717171717171717,"JdJcKc":0.2868686868686869,"Th3s4s":0.19747474747474747,"Kh2c6s":0.22424242424242424,"9dAd5c":0.17474747474747473,"Ah3d4s":0.13737373737373737,"3d7d3c":0.13787878787878788,"3h4dQd":0.18181818181818185,"
{"6d8c6s":0.9665289256198346,"QhTc9s":0.31290174471992654,"QcKc9s":0.36767676767676766,"9h2d8c":0.47323232323232317,"8d4c2s":0.35844811753902667,"5c2sKs":0.09719416386083052,"8hAhAs":0.04242424242424243,"Td3cTc":0.45128558310376493,"Qd4sAs":0.04363636363636365,"KhQdAc":0.04642255892255892,"3hAh7s":0.1593939393939394,"6hAh2d":0.14457912457912458,"9hQh5c":0.3453168044077135,"Ah3sKs":0.020286195286195286,"3d4d5s":0.9508953168044076,"TdKd7s":0.1937710437710438,"4h8cQc":0.5487144168962351,"Jd5c3s":0.35849403122130397,"3s6sJs":0.48943985307621674,"QdTcJs":0.049770431588613405,"Tc3s6s":0.6078512396694215,"Jc9sAs":0.07683501683501684,"3d4c3s":0.3362258953168044,"6hTcAc":0.4543434343434343,"4h8cJs":0.3584940312213039,"5d9sQs":0.31423324150596876,"5d5c9c":0.5359044995408632,"7dJcQc":0.6651056014692379,"6hAdTs":0.16168350168350168,"JdJcKc":0.30673400673400675,"Th3s4s":0.31423324150596876,"Kh2c6s":0.22177328843995509,"9dAd5c":0.2171043771043771,"Ah3d4s":0.17562289562289563,"3d7d3c":0.5758034894398532,"3h4dQd":0.298852157