Skip to content

Instantly share code, notes, and snippets.

View rik's full-sized avatar

Anthony Ricaud rik

View GitHub Profile
@rik
rik / gist:6520487
Created September 11, 2013 07:50
Error while scraping
TypeError: Cannot read property 'body' of undefined
at Request._callback (/Users/rik24d/code/travis-scrape-gaia/node_modules/travis-ci/lib/travis-http.js:32:40)
at self.callback (/Users/rik24d/code/travis-scrape-gaia/node_modules/travis-ci/node_modules/request/index.js:148:22)
at Request.EventEmitter.emit (events.js:95:17)
at ClientRequest.self.clientErrorHandler (/Users/rik24d/code/travis-scrape-gaia/node_modules/travis-ci/node_modules/request/index.js:257:10)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at CleartextStream.socketCloseListener (http.js:1523:9)
at CleartextStream.EventEmitter.emit (events.js:117:20)
at tls.js:688:10
at process._tickCallback (node.js:415:13)
@rik
rik / cli.sh
Created August 7, 2013 07:48 — forked from karlcow/cli.sh
http GET http://www.otsukare.info/ | grep '<a href="/2' | sed 's,.*<a href="\(.*\)" rel=".*,http://www.otsukare.info\1,' | xargs -n1 http HEAD
@rik
rik / default.diff
Last active December 18, 2015 02:09 — forked from anonymous/default.txt
You'll need to do reset-gaia to give the template app the good permissions (or edit permissions.sqlite).
test_apps/template/index.html | 16 ++++++++++++++++
test_apps/template/manifest.webapp | 6 +++++-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/test_apps/template/index.html b/test_apps/template/index.html
index 4611ccd..baca876 100644
--- a/test_apps/template/index.html
+++ b/test_apps/template/index.html
@@ -16,6 +16,22 @@
</style>
require('/shared/js/l10n.js');
//mocha.setup({globals: ['jsCount', 'totalResult']});
suite('l10n', function(done) {
var _;
suiteSetup(function() {
_ = navigator.mozL10n.get;
var script = document.createElement('script');
#main {
@extends .2-column;
@media (min-device-width: 500px) {
@extends .4-column;
}
}
--- iergo-orig.svg 2012-07-18 13:00:25.000000000 +0200
+++ iergo.svg 2012-07-18 13:01:33.000000000 +0200
@@ -2,20 +2,20 @@
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY st0 "fill:#7AC943;">
- <!ENTITY st1 "font-family:'GillSans-LightItalic';">
+ <!ENTITY st1 "font-family:'GillSans-Light', 'Gill Sans'; font-style: italic; font-weight: lighter;">
<!ENTITY st2 "opacity:0.2;fill:#808080;">
<!ENTITY st3 "opacity:0.2;fill:#FF931E;">
@rik
rik / gist:2992235
Created June 26, 2012 00:12
New redirects
RewriteRule ^/en-US/mobile(/?)$ /b/en-US/mobile$1 [PT]
RewriteRule ^/en-US/firefox/mobile/features(/?)$ /b/en-US/firefox/mobile/features$1 [PT]
RewriteRule ^/(\w{2,3}(?:-\w{2}(?:-mac)?)?/)?firefox/mobile/features(/?)$ /en-US/firefox/mobile/features/ [L,R=302]
RewriteRule ^/en-US/firefox/mobile/faq(/?)$ /b/en-US/firefox/mobile/faq$1 [PT]
RewriteRule ^/(\w{2,3}(?:-\w{2}(?:-mac)?)?/)?firefox/mobile/faq(/?)$ /en-US/firefox/mobile/faq/ [L,R=302]
RewriteRule ^/en-US/firefox/mobile/platforms(/?)$ /b/en-US/firefox/mobile/platforms$1 [PT]
RewriteRule ^/(\w{2,3}(?:-\w{2}(?:-mac)?)?/)?firefox/mobile/platforms(/?)$ /en-US/firefox/mobile/platforms/ [L,R=302]
@rik
rik / gist:2873520
Created June 5, 2012 08:07
Save battery life while at Djangocon EU
document.querySelector('.tram').classList.remove('tram');
document.querySelector('.cloud_big').src = '';
document.querySelector('.cloud_small').src = '';
@rik
rik / template.html
Created March 8, 2012 19:51 — forked from paulrouget/template.html
Empty HTML5 page
<!DOCTYPE html>
<meta charset=utf-8 />
<title>test</title>
<style>
</style>
<div></div>
@rik
rik / jpegtran-directory.sh
Created July 14, 2011 22:28
Run jpegtran on every image in a directory (and subdirectories)
#!/usr/bin/env bash
function optimize
{
echo $1
filesize=`stat -f %z "$1"`
if [[ $filesize -lt 10000 ]]; then
jpegtran -copy none -optimize "$1" > "$1.bak"
echo "pet
else