Skip to content

Instantly share code, notes, and snippets.

View malexandre's full-sized avatar

Marc Alexandre malexandre

View GitHub Profile
@malexandre
malexandre / Side Bar.sublime-menu
Created May 15, 2014 13:02
Opening file path in terminal from ST3 (path = /home/marc/.config/sublime-text-3/Packages/User/SideBarEnhancements/Open With/)
[
{"id": "side-bar-files-open-with",
"children":
[
{
"caption": "Chrome",
"id": "side-bar-files-open-with-chrome",
"command": "side_bar_files_open_with",
"args": {
@malexandre
malexandre / gist:10994396
Last active August 29, 2015 13:59
Exécution des tests en Python

Pour exécuter des tests en Python à partir de la console, il faut utiliser nosetests. Nosetests est dispo sur les dépots Python avec son plugins Google AppEngine :

sudo pip install nose nosegae

Il faut ensuite appeler la bonne ligne de commande. Pour se faire, voici une fonction bash à mettre dans son ~/.bashrc :

function gae-test()
{
@malexandre
malexandre / Main.sublim-menu
Created April 17, 2014 10:03
Config file to add custom 3 pane mode in sublime text 3, with one pane large as the 2 other pane combined. Put this file in .config/sublime-text-3/Packages/User.
[{
"id": "view",
"children": [{
"id": "layout",
"children": [
{
"command": "set_layout",
"caption" : "Custom: 3 Pane (2T 1B)",
"mnemonic": "C",
"args": {
@malexandre
malexandre / gist:3934578
Created October 22, 2012 21:34
Bash function for Jekyll to create drafts & publish them
function draft()
{
local editor=""
local title=""
while test $# -gt 0; do
case "$1" in
-c)
editor="$2"
shift
shift
@malexandre
malexandre / Rakefile
Created October 22, 2012 15:07
Rakefile for Jekyll with draft & publish management
require 'date'
desc "Given a title as an argument, create a new post file"
task :draft, :title do |t, args|
puts "Creating _drafts/#{args.title}"
filename = "#{args.title.gsub(/\s/, '_').downcase}.markdown"
path = File.join("_drafts", filename)
if File.exist? path; raise RuntimeError.new("Won't clobber #{path}"); end
File.open(path, 'w') do |file|
file.write <<-EOS