Skip to content

Instantly share code, notes, and snippets.

@yaph
yaph / sitemonitor.js
Last active December 31, 2017 03:07
Google Apps Script Site Monitor
function checkURLs() {
var errors = [];
var ss = SpreadsheetApp.getActiveSpreadsheet();
var rows = ss.getDataRange().getValues();
for (i in rows) {
var url = rows[i][0];
var response = UrlFetchApp.fetch(url, {muteHttpExceptions: true});
var status = response.getResponseCode();
if (status !== 200)
errors.push(status + ' - '+ url);
@yaph
yaph / startmongoopenshift.sh
Created June 15, 2012 15:47
Start MongoDB cartridge for OpenShift app
rhc app cartridge start -a APP -c mongodb-2.0 -l USER
@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,
@yaph
yaph / README.md
Created May 18, 2012 22:23
Map of GitHub Commits

README

A geographic map that displays GitHub commits by countries. To view the map and information on how it was created see this article.

You can also view this gist at bl.ocks.org. If you fork it and apply changes you can see them live at bl.ocks.org/YOUR_GIST_ID.

@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 / 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 / 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 / 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 / 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 / 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;
};