Skip to content

Instantly share code, notes, and snippets.

View KartikTalwar's full-sized avatar
🚀
Gone phishing

Kartik Talwar KartikTalwar

🚀
Gone phishing
View GitHub Profile
@nakhli
nakhli / editor.css
Last active October 22, 2019 21:06
Backbone.js tutorial - Part 1 - www.sinbadsoft.com
.shape{
height: 100%;
width: 100%;
}
.circle {
border-radius: 50%/50%;
-moz-border-radius: 50%/50%;
-webkit-border-radius: 50%/50%;
}
.hide {
@aemkei
aemkei / LICENSE.txt
Last active April 12, 2024 21:27 — forked from 140bytes/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@smitec
smitec / Example
Created February 20, 2012 03:13
Python boolean statement to RPN
parse("( S < 16 and T = \"P\" ) or ( S > 16 and L = 50 )") => ['S<16', 'T="P"', 'and', 'S>16', 'L=50', 'and', 'or']
@pheuter
pheuter / sc-dl.js
Created March 5, 2012 20:44
Bookmarklet that generates download link for a Soundcloud upload
(function(d) {
var dl = d.createElement('a');
dl.innerText = 'Download MP3';
dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1];
dl.download = d.querySelector('em').innerText+".mp3";
d.querySelector('.primary').appendChild(dl);
dl.style.marginLeft = '10px';
dl.style.color = 'red';
dl.style.fontWeight = 700;
})(document);
@hrldcpr
hrldcpr / tree.md
Last active May 1, 2024 00:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@badboy
badboy / notepages.user.js
Created March 24, 2012 17:55
Easy and fast key combo for notepag.es
// ==UserScript==
// @id org.userscripts.users.badboy.notepag-es-key-combo
// @name notepag.es-key-combo
// @description Add key combos to notepag.es
// @version 2012.03.24
// @author badboy_
// @homepage http://fnordig.de/
// @include http://notepag.es/*
// ==/UserScript==
require 'spec_helper'
describe "Brewery" do
it "makes good stuff" do
beer.should be :good
end
it "makes not too much bottles" do
@bottles.should == 10
@jrochkind
jrochkind / gist:2636355
Created May 8, 2012 15:31
reddit 'hot' algorithm, in ruby, with typo fixed
require 'date'
# Actually doesn't matter WHAT you choose as the epoch, it
# won't change the algorithm. Just don't change it after you
# have cached computed scores. Choose something before your first
# post to avoid annoying negative numbers. Choose something close
# to your first post to keep the numbers smaller. This is, I think,
# reddit's own epoch.
$our_epoch = Time.local(2005, 12, 8, 7, 46, 43).to_time
@pachacamac
pachacamac / clusterize.rb
Created May 22, 2012 19:11
Cluster algorithm for n-dimensional data and a given number of clusters
# A
# B
#
# D
#
# C
# E
#
# F
#
@I82Much
I82Much / Scramble Solver Output.txt
Created May 30, 2012 05:27
Scramble Solver Output
FoundWord(word='a', locations=[Location(row=2, col=0)])
FoundWord(word='al', locations=[Location(row=2, col=0), Location(row=1, col=1)])
FoundWord(word='alice', locations=[Location(row=2, col=0), Location(row=1, col=1), Location(row=2, col=2), Location(row=2, col=3), Location(row=3, col=2)])
FoundWord(word='alien', locations=[Location(row=2, col=0), Location(row=1, col=1), Location(row=2, col=2), Location(row=3, col=2), Location(row=3, col=3)])
FoundWord(word='alin', locations=[Location(row=2, col=0), Location(row=1, col=1), Location(row=2, col=2), Location(row=3, col=3)])
FoundWord(word='aline', locations=[Location(row=2, col=0), Location(row=1, col=1), Location(row=2, col=2), Location(row=3, col=3), Location(row=3, col=2)])
FoundWord(word='alit', locations=[Location(row=2, col=0), Location(row=1, col=1), Location(row=2, col=2), Location(row=2, col=1)])
FoundWord(word='alite', locations=[Location(row=2, col=0), Location(row=1, col=1), Location(row=2, col=2), Location(row=2, col=1), Location(row=3, col=2)])
F