Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
# Gives you file-by-file change stats between two archives.
# Assuming your two archives are original.tar.gz and modified.tar.gz in
# the curent directory.
# I know that there is a tool called diffstat for this very purpose,
# and git probably uses it internally as well. I wanted to demo the
# git-diff --stat command.
@Anks
Anks / trac-post-commit-hook.py
Created July 7, 2009 08:24
Adding a command to create a new version to trac's svn post-commit hook
#!/usr/bin/env python
# trac-post-commit-hook
#
# This version trac-post-commit-hook has a few customizations.
#
# 1. fix/fixes/fixed commands set status to 'testing' instead of closed.
#
# 2. Added a new command to create new versions. Any commit message with
# a pattern 'tagging version VERSION_NUMBER' or 'tagged version
@Anks
Anks / GoogleDocsHeadingNumbers.css
Created August 30, 2009 12:34
CSS for adding header numbering to google documents
/**
* CSS to add section numbers to top-level headings in
* a Google Docs (or any HTML) document.
*
* See <http://www.w3.org/TR/CSS2/generate.html> for
* more details.
*/
body {
counter-reset: section;
}
@Anks
Anks / README.md
Created May 19, 2011 17:24 — forked from bergie/README.md
Falsy Values tutorials
We deeply regret to inform you that we will not be able to deliver your
subscription copy of the February 11th issue of The Economist.
This issue includes a special report on Pakistan and features a map
showing the disputed territories. India does not allow us to show the
current effective border, requiring us instead to show only its
territorial claims. As a result, the issue has been seized by the Indian
customs authorities.
We apologise sincerely for any inconvenience this may cause. We will be
@Anks
Anks / flipkart-flyte-high-quality-downloads.js
Created March 4, 2012 10:25
Change download bitrate to 320kbps on Flipkart
$('select.bit-rate').each(function() { $(this).find('option:first').attr('selected', 'selected'); });
@Anks
Anks / nthloop.logo.pde.java
Created August 13, 2012 14:33
nth loop logo processing sketch
color[] colors = { color(85, 98, 112), color(78, 205, 196),
color(199, 244, 100), color(255, 107, 107),
color(196, 77, 88)
};
float rot = 0;
int colorIndex = 0;
void setup() {
frameRate(26);
size(325, 200, P3D);
@Anks
Anks / package.json
Created August 20, 2012 08:32
Easy local development with a node.js proxy
{
"name": "your-app-name",
"version": "0.0.1",
"private": true,
"dependencies": {
"http-proxy": "0.8.x",
"connect": "2.3.x"
}
}
@Anks
Anks / d3-number-transition.html
Last active December 25, 2015 09:59
Transitioning numbers using d3.js
<!DOCTYPE html>
<meta charset="utf-8">
<style></style>
<body>
<h2>Transitioning numbers</h2>
<h3 data-value="0" id="the-number">0</h3>
<input type="number" value="0" id="new-number" step="100" />
@Anks
Anks / deft-title-fn-strip-file-vars.el
Created September 9, 2014 01:00
deft-mode – Strip file variables from title line

;; Customise deft to remove file-vars from the title line. ;; ;; I use ‘markdown-mode with deft usually, but for some longform files, ;; I prefer using ‘org-mode. ;; ;; The easiest way to do this is to use a file variable like so: ;; ;; -*- mode: org; -*- ;; ;; in the first line of the file. This makes the file open in ‘org-mode