Skip to content

Instantly share code, notes, and snippets.

@maettig
maettig / LICENSE.txt
Created May 7, 2012 08:09 — forked from 140bytes/LICENSE.txt
imageconvolution in 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 Thiemo Mättig <http://maettig.com>
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
@deepakjois
deepakjois / generate-fiddle.sh
Created December 4, 2011 02:32
A convenient way to generate Github gists and link them to JSFiddle.
#!/bin/sh
# Usage: generate-fiddle <folder>
# Creates a folder and adds some files commonly used with JSFiddle
set -e
# Create folder
mkdir $1
cd $1
@benjchristensen
benjchristensen / index.html
Created August 16, 2011 03:21
Animated Line Graphs / Sparklines using SVG Path and d3.js
<html>
<head>
<title>Animated Sparkline using SVG Path and d3.js</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style>
/* tell the SVG path to be a thin blue line without any area fill */
path {
stroke: steelblue;
stroke-width: 1;
fill: none;
@gf3
gf3 / ago.js
Created June 2, 2011 18:43
Super small relative dates
module.exports = (function(){
const MS =
{ seconds: 1000
, minutes: 60 * 1000
, hours: 60 * 60 * 1000
, days: 24 * 60 * 60 * 1000
, weeks: 7 * 24 * 60 * 60 * 1000
, months: 30 * 7 * 24 * 60 * 60 * 1000
, years: 365 * 24 * 60 * 60 * 1000 }
@deepakjois
deepakjois / main.go
Created May 24, 2011 02:06
MP3 file information parsing using Go and libmpg123
package main
import "mp3"
import "os"
func main() {
mp3.PrintInfo(os.Args[1])
}
@jed
jed / LICENSE.txt
Created May 10, 2011 16:38 — forked from 140bytes/LICENSE.txt
use cached DOM elements to escape HTML
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
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
// 1: how could you rewrite the following to make it shorter?
// Naming methods with superfluous characters that are not descriptive is a waste of time, so I would shorten the method names.
if (foo) {
bar.something(el);
} else {
bar.somethingElse(el);
}
window.onload = function () {
if (! document.querySelectorAll) { // Quick & Dirty way to tell the good browsers from the bad ones.
alert("Please upgrade your browser to view this site.");
}
};