Skip to content

Instantly share code, notes, and snippets.

View Laurent-Sarrazin's full-sized avatar

Laurent Sarrazin Laurent-Sarrazin

View GitHub Profile
cask 'rightzoom' do
version :latest
sha256 :no_check
url 'http://www.blazingtools.com/mac/RightZoom20.zip'
name 'Right Zoom'
homepage 'http://www.blazingtools.com/right_zoom_mac.html'
app 'RightZoom.app'
#!/bin/bash
[ "$DB_NAME" ] || DB_NAME='wordpress'
[ "$DB_PASS" ] || DB_PASS='root'
[ "$THEMES" ] || THEMES='twentysixteen'
[ "$WP_DEBUG" ] || WP_DEBUG='false'
[ "$ADMIN_EMAIL" ] || ADMIN_EMAIL="admin@${DB_NAME}.com"
[ "$SEARCH_REPLACE" ] && \
BEFORE_URL=$(echo "$SEARCH_REPLACE" | cut -d ',' -f 1) && \
AFTER_URL=$(echo "$SEARCH_REPLACE" | cut -d ',' -f 2) || \
@Laurent-Sarrazin
Laurent-Sarrazin / kaamelott2
Created November 6, 2015 20:37
List of characters that never shared an episode with Karadoc in season 1
+------------------------------+
| c.name |
+------------------------------+
| "Acheflour" |
| "Aconia Minor" |
| "Aelis" |
| "Anna" |
| "Anton" |
| "Appius Manilius" |
| "Attila" |
@Laurent-Sarrazin
Laurent-Sarrazin / kaamelott1
Last active November 6, 2015 15:08
Number of episodes of the 1st season in which each character appears
+----------------------------+
| c.name | n |
+----------------------------+
| "Arthur Pendragon" | 99 |
| "Léodagan" | 55 |
| "Perceval" | 49 |
| "Guenièvre" | 47 |
| "Lancelot du Lac" | 44 |
| "Karadoc" | 37 |
| "Père Blaise" | 21 |
@Laurent-Sarrazin
Laurent-Sarrazin / gist:adfe5fad1b23874dfca2
Created July 1, 2014 15:28
Spotify to Hipchat (with bit.ly link)
set _string to load script alias ((path to desktop as text) & "_string.scpt")
tell application "Spotify"
set current_track to null
set current_artist to null
set current_album to null
set current_track_url to null
set current_track_spotify_url to null
repeat until application "Spotify" is not running
#!/bin/bash
# php switch for homebrew
# $ brew tap josegonzalez/php && brew install php53 --with-mysql && brew install php54 --with-mysql
# Might as well ask for password up-front, right?
sudo -v
VERSION_FILE="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/php-switch.version"
@Laurent-Sarrazin
Laurent-Sarrazin / create_note_linked_notebook
Created May 2, 2014 11:40
Evernote API : create notes in a linked notebook
$authToken = "YOUR DEV TOKEN";
$client = new Client(array('token' => $authToken));
$noteStore = $client->getNoteStore();
# get linked notebooks
$linked_notebooks = $noteStore->listLinkedNotebooks($authToken);
$linked_notebook = $linked_notebooks[0];
@Laurent-Sarrazin
Laurent-Sarrazin / shared_notes.py
Created April 17, 2014 11:54
Get shared notes with the evernote api
import evernote.edam.notestore.NoteStore as NoteStore
from evernote.api.client import EvernoteClient
from evernote.api.client import Store
from evernote.edam.notestore.ttypes import NoteFilter, NotesMetadataResultSpec
auth_token = "YOUR TOKEN"
client = EvernoteClient(token=auth_token, sandbox=True)
sqlite3 -separator ' ' ${COOKIES:-Cookies} \
'select host_key, "TRUE", path, "FALSE", expires_utc, name, value from cookies'
from evernote.api.client import EvernoteClient
dev_token = "put your dev token here"
client = EvernoteClient(token=dev_token)
userStore = client.get_user_store()
user = userStore.getUser()
print user.username