Skip to content

Instantly share code, notes, and snippets.

Avatar

Pierre Spring caillou

View GitHub Profile
View communes.json
[{"zip":"1002","0":"1002","name":"Lausanne","1":"Lausanne","y":"536715","2":"536715","x":"151315","3":"151315","latitude":"46.5101","4":"46.5101","longitude":"6.61407","5":"6.61407","merc_x":"736275","6":"736275","merc_y":"5831470","7":"5831470","pixel_x":"177","8":"177","pixel_y":"437","9":"437","canton":"VD","10":"VD"},{"zip":"1008","0":"1008","name":"Prilly","1":"Prilly","y":"534375","2":"534375","x":"153265","3":"153265","latitude":"46.5275","4":"46.5275","longitude":"6.58331","5":"6.58331","merc_x":"732851","6":"732851","merc_y":"5834260","7":"5834260","pixel_x":"170","8":"170","pixel_y":"431","9":"431","canton":"VD","10":"VD"},{"zip":"1009","0":"1009","name":"Pully","1":"Pully","y":"538470","2":"538470","x":"150535","3":"150535","latitude":"46.5033","4":"46.5033","longitude":"6.63704","5":"6.63704","merc_x":"738832","6":"738832","merc_y":"5830360","7":"5830360","pixel_x":"182","8":"182","pixel_y":"440","9":"440","canton":"VD","10":"VD"},{"zip":"1020","0":"1020","name":"Renens","1":"Renens","y":"533595",
View gist:3342462
{
"color_scheme": "Packages/User/Monokai-Seld.tmTheme",
"font_size": 15.0,
"ignored_packages":
[
"SublimeCodeIntel"
],
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true
}
View horror.less
.tree > ul > li > ul > li > ul > li {
@levelPadding: 25px;
padding-left: @levelPadding;
& > ul > li {
margin-left: -@levelPadding;
padding-left: @levelPadding * 2;
& > ul > li {
margin-left: -@levelPadding * 2;
padding-left: @levelPadding * 3;
View index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<style type="text/css">
path {
fill: none;
stroke: black;
}
</style>
@caillou
caillou / gist:2021918
Created Mar 12, 2012
Track mailto, file download and external links using Google Analytics
View gist:2021918
/*globals pageTracker: true */
(function () {
"use strict";
var delegate, clickCallback, handleLink, track;
// generic delegate function
delegate = function (element, tagName, eventName, callback) {
var eventListener;
@caillou
caillou / gist:1931490
Created Feb 28, 2012
Rewrite URLs in Wordpress
View gist:1931490
<?php
/*
Plugin Name: ReWrite
Plugin URI: http://nelm.io/
Description: A Plugin to ReWrite URLs.
Version: 0.1
Author: Pierre Spring
Author URI: http://nelm.io/pierre
License: GPL2
*/
@caillou
caillou / gist:1446583
Created Dec 8, 2011
Translation for relativeDate of moment.js
View gist:1446583
/*jslint white: false */
var langs;
langs = {
"de" : {
today: "heute um %time",
tomorrow: 'morgen um %time',
next: '%weekday um %time',
yesterday: 'gestern um %time',
@caillou
caillou / gist:1420463
Created Dec 1, 2011
Possible addition to moment.js
View gist:1420463
// We assume it's Friday, December 2nd, 2 PM
// This could be interesting for a listing of events in a calendar.
// Two Questions:
// 1. How would you call the function?
// 2. What would you return for the dates in 1 and 2 weeks?
moment().xxx() // "Today at 2 PM"
moment().add('hours', 1).xxx() // "Today at 3 PM"
@caillou
caillou / gist:1390151
Created Nov 23, 2011
Google's clearQuery code
View gist:1390151
gh.addEventListener("mousedown", function(a) {
a.preventDefault();
S.value = "";
S.value = S.value; // hrhrhr...
if (T)
jh.innerText = T.innerText = ""; // hrhrhr...
yg++;
vg = ug = 0;
S.focus(); // interesting. it really has no effect.
zh();