Skip to content

Instantly share code, notes, and snippets.

@datfaf
datfaf / fiddle.css
Created June 14, 2011 05:43 — forked from zalun/fiddle.css
jsfiddle
body {
font-family: Helvetica, Verdana
}
p {
padding: 7px 10px;
}
#demo {
border: 1px solid #999;
}
@datfaf
datfaf / fiddle.css
Created June 14, 2011 11:07 — forked from zalun/fiddle.css
jsfiddle
body {
font-family: Helvetica, Verdana
}
p {
padding: 7px 10px;
}
#demo {
border: 1px solid #999;
}
@datfaf
datfaf / gist:1031627
Created June 17, 2011 15:17 — forked from pisi/gist:949867
Delicious bookmarklet
javascript:(function(){f='http://www.delicious.com/save?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'&notes='+encodeURIComponent(''+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text))+'&v=6&';a=function(){if(!window.open(f+'noui=1&jump=doclose','deliciousuiv6','location=yes,links=no,scrollbars=no,toolbar=no,width=550,height=550'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()
@datfaf
datfaf / a_templates-bmlet.html
Created July 18, 2011 13:18
small edits to templates/bmlet.html @ https://github.com/jpmens/scrumptious bookmarklet
-<a href="javascript:(function(){t=document.title;d=''+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);if(!d)d=prompt('No text selected; enter description',t);if(!d)return 0;tags=prompt('Enter space-separated list of tags','');if(!tags)return 0;uri='{{url}}';f=document.createElement('form');f.method='post';f.action=uri;i0=document.createElement('input');i0.type='text';i0.name='url';i0.value=location.href;i1=document.createElement('input');i1.type='text';i1.name='description';i1.value=d;i2=document.createElement('input');i2.type='text';i2.name='title';i2.value=t||'no title';i3=document.createElement('input');i3.type='text';i3.name='tags';i3.value=tags;f.appendChild(i0);f.appendChild(i1);f.appendChild(i2);f.appendChild(i3);b=document.createElement('body');b.appendChild(f);f.submit();})()">drag me to your bookmarks bar</a> to install the bookmarklet.</li>
12
+<a href="javascript:(function(){t=document.title;d=''+(window.getSel
@datfaf
datfaf / dynamic_select.js
Created July 27, 2011 16:19
js dynamic_select + ajax
function dynamicSelect(id1, id2) {
// Feature test to see if there is enough W3C DOM support
if (document.getElementById && document.getElementsByTagName) {
// Obtain references to both select boxes
var sel1 = document.getElementById(id1);
var sel2 = document.getElementById(id2);
// Clone the dynamic select box
var clone = sel2.cloneNode(true);
// Obtain references to all cloned options
var clonedOptions = clone.getElementsByTagName("option");
@datfaf
datfaf / perlab.pl
Created August 17, 2011 17:43 — forked from FurryHead/perlab.pl
TinyCore Linux appbrowser written in perl, can be run from OSs other than TinyCore.
#!/usr/bin/perl -w
use warnings;
use strict;
use Term::ReadKey;
my $tce_mirror = "http://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/";
my $tce_dir = `cat /opt/.tce_dir`;
$tce_dir = "./tce" if ($tce_dir eq "");
chomp $tce_dir;

(a gist based on the old toolmantim article on setting up remote repos)

To collaborate in a distributed development process you’ll need to push code to remotely accessible repositories.

This is somewhat of a follow-up to the previous article setting up a new rails app with git.

For the impatient

Set up the new bare repo on the server:

@datfaf
datfaf / gist:1191859
Created September 3, 2011 22:07 — forked from jeremyBanks/gist:9224
[2010-01] numbers written using entirely hexable characters
# Numbers that can be written in hex characters.
# 1 may only use as L or I exclusively in a given word.
# egrep -i "^([ABCDEFOLZSGT]+|[ABCDEFOIZSGT]+)$" /usr/share/dict/words
A
a
aa
aal
Ab
aba
abac
@datfaf
datfaf / LICENSE.txt
Created September 4, 2011 00:35 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
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
@datfaf
datfaf / supplant.js
Created September 4, 2011 01:18 — forked from couchoud/supplant.js
basic hs templating using String object and Regex
if (typeof String.prototype.supplant !== 'function') {
String.prototype.supplant = function (o) {
return this.replace(/{([^{}]*)}/g,
function (a, b) {
var r = o[b];
return typeof r === 'string' ? r : a;
});
};
}