Skip to content

Instantly share code, notes, and snippets.

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/home/rgomez/bin/eclipse
Name=Eclipse
Icon=/home/rgomez/app/eclipse/icon.xpm
@yaph
yaph / deliciousexport2list.js
Created November 26, 2011 22:55
Create an unordered list with only href anchor attributes from a Delicious bookmark export
var list = '';
$('dl dt').each(function(idx,elt){
var a = $(elt).find('a');
list += '<li><a href="' + a.attr('href') + '">' + a.text() + '</a></li>\n';
});
console.log('<ul>'+list+'</ul>');
@yaph
yaph / gist:1561397
Created January 4, 2012 18:40
prevent addition of PHPSESSID to links in .htaccess when user agents don't support cookies
php_value session.use_only_cookies 1
php_value session.use_trans_sid 0
@yaph
yaph / escapeHTML.js
Created January 21, 2012 19:37
Fast HTML tag escape JavaScript function
// see benchmark at http://jsperf.com/encode-html-entities
String.prototype.escapeHTML = function(){
var div = document.createElement('div');
div.appendChild(document.createTextNode(this));
return div.innerHTML;
};
@yaph
yaph / eulerproblem1.py
Created January 30, 2012 21:42
Project Euler: problem 1
sum([i for i in range(1000) if (i%3==0 or i%5==0)])
@yaph
yaph / HTML5 Skeleton template.html
Created April 10, 2012 23:27 — forked from rtuin/HTML5 Skeleton template.html
HTML5 skeleton template
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
@yaph
yaph / gource_video.sh
Created April 13, 2012 17:46
create a portable pixmap file and then a mp4 file with gource, ppm files may get very very large
gource -1280x720 -o gource.ppm
ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i gource.ppm -vcodec libx264 -vpre ultrafast -crf 1 -threads 0 -bf 0 gource.mp4
@yaph
yaph / gource_video_480p60.sh
Created April 13, 2012 18:36
create a 480p video with 60 frames/s and max time scale with gource
gource --auto-skip-seconds 1 --seconds-per-day 1 --time-scale 4 -640x480 -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -vpre ultrafast -crf 1 -threads 0 -bf 0 gource_480p60.mp4
@yaph
yaph / README.md
Created May 11, 2012 21:06
GitHub Language Correlations Circle Pack Visualization

README

View this Gist at bl.ocks.org

A circle packing visualization of the programming language correlations dataset, that is available via Google's BigQuery service as part of the GitHub Archive project.

Included are the 10 most popular programming languages on GitHub at the time of creation (JavaScript, Ruby, Python, Shell, Java, PHP, C, Perl, C++, Objective-C) and their correlated languages with a minimum correlation score of 10. Read more about how correlation scores are calculated.

On the demo page move the mouse pointer over the big containing circles to see the name of the source languages and over the smaller contained circles to see the rounded correlation values.

@yaph
yaph / google_twunter_lol
Created June 12, 2012 19:44 — forked from jamiew/google_twunter_lol
All the dirty words from Google's "what do you love" project: http://www.wdyl.com/
easterEgg.BadWorder.list={
"4r5e":1,
"5h1t":1,
"5hit":1,
a55:1,
anal:1,
anus:1,
ar5e:1,
arrse:1,
arse:1,