Skip to content

Instantly share code, notes, and snippets.

View thibaudcolas's full-sized avatar
😀

Thibaud Colas thibaudcolas

😀
View GitHub Profile
@thibaudcolas
thibaudcolas / french-departments.json
Created May 11, 2013 22:21
French Departments — As of 2011. Taken from rdf.insee.fr
{
"metadata" : {
"title" : "French Departments INSEE COG Dataset 2011",
"date" : "2013-04-21",
"version" : "1.0.0"
},
"departements" : {
"DEP_01" : {
"uri" : "DEP_01",
"code" : "01",
@thibaudcolas
thibaudcolas / host.html
Created October 6, 2013 22:13
Reproducing the noConflict iframeheight bug
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Page calling the iframe</title>
<style> body {background-color: black;} </style>
</head>
<body>
Hi, I'm host.
@thibaudcolas
thibaudcolas / instantclick-browserify-1.html
Last active August 29, 2015 14:11
UMD-wrapped InstantClick, bundled with browserify for the Web. Test (beware broken links between the two files): https://rawgit.com/ThibWeb/1c6ea5c6b87b623aa217/raw/caca7eadff5f5ee319dac62c9a94d847cf22e931/instantclick-browserify-1.html
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>#1 Hello world!</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<p>#1 Hello world!</p>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thibaudcolas
thibaudcolas / rubegoldbash.sh
Last active August 29, 2015 14:14
will's RubeGoldBash game
ls ~ | grep bash
ls ~ | grep bash | wc -l
history
dig +short myip.opendns.com @resolver1.opendns.com
curl -s ip.appspot.com
curl -s ip.appspot.com | xargs -n 1 curl -s "freegeoip.net/csv/$1" | cut -d ',' -f '9 10' | sed 's/,/\&lon=/g' | xargs -n 1 echo "http://api.openweathermap.org/data/2.5/weather?mode=html&lat=$1" | sed 's/ //g' | xargs -n 1 curl -s $1 | lynx -stdin -dump
ps aux
[ $[ $RANDOM % 6 ] == 0 ] && echo "You die" || echo "You live"
/***************** hello-es6.js *****************/
console.log('HELLO ES6');
/***************** template-strings.js *****************/
const name = process.argv[2];
if (navigator.userAgent.indeOf('Apple-iPhone/') !== -1) ga('send', 'dimension', 'MobileDeviceModel', 'iPhone');
if (navigator.userAgent.indeOf('Apple-iPhone1C2/') !== -1) ga('send', 'dimension', 'MobileDeviceModel', 'iPhone 3G');
if (navigator.userAgent.indeOf('Apple-iPhone2C1/') !== -1) ga('send', 'dimension', 'MobileDeviceModel', 'iPhone 3GS');
if (navigator.userAgent.indeOf('Apple-iPhone3C1/') !== -1) ga('send', 'dimension', 'MobileDeviceModel', 'iPhone 4');
if (navigator.userAgent.indeOf('Apple-iPhone3C2/') !== -1) ga('send', 'dimension', 'MobileDeviceModel', 'iPhone 4');
if (navigator.userAgent.indeOf('Apple-iPhone3C3/') !== -1) ga('send', 'dimension', 'MobileDeviceModel', 'iPhone 4');
if (navigator.userAgent.indeOf('Apple-iPhone4C1/') !== -1) ga('send', 'dimension', 'MobileDeviceModel', 'iPhone 4S');
if (navigator.userAgent.indeOf('Apple-iPhone5C1/') !== -1) ga('send', 'dimension', 'MobileDeviceModel', 'iPhone 5');
if (navigator.userAgent.indeOf('Apple-iPhone5C2/') !== -1) ga('send', 'dimension', 'Mobil
@thibaudcolas
thibaudcolas / nightmare.js
Created December 2, 2015 20:22
Nightmare example
'use strict';
require('mocha-generators').install();
var expect = require('chai').expect;
var nightmare = require('nightmare');
describe('Test blog content', function() {
this.timeout(10000);
@thibaudcolas
thibaudcolas / actionTypes.js
Created May 30, 2016 14:17
Example of Redux action types definition with keyMirror and ES6.
import keyMirror from 'keymirror';
export default keyMirror({
LOAD_DATASETS_START: null,
LOAD_DATASETS_SUCCESS: null,
LOAD_DATASETS_ERROR: null,
LOAD_DATASETS_NOT_FOUND: null,
LOAD_DATA_START: null,
LOAD_DATA_SUCCESS: null,
@thibaudcolas
thibaudcolas / links.js
Last active January 30, 2022 05:46
Get all links on a site's page