Skip to content

Instantly share code, notes, and snippets.

View keymap.c
/* Copyright 2015-2017 Jack Humbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
View osx-for-hackers.sh
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
View Preferences.sublime-settings
// Installed Packages
//
// * AdvancedNewFile
// * Base16 Color Schemes
// * Emmet
// * Sass
// * SublimeCodeIntel
// * Theme - Soda
// * Theme - Spacegray
@Axiol
Axiol / Monokai.terminal
Created Dec 24, 2013
My OS X terminal setup
View Monokai.terminal
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECkw
LjA3ODQzMTM3MjU1IDAuMTE3NjQ3MDU4OCAwLjA5ODAzOTIxNTY5ABACgALSEBESE1ok
Y2xhc3NuYW1lWCRjbGFzc2VzV05TQ29sb3KiEhRYTlNPYmplY3RfEA9OU0tleWVkQXJj
@Axiol
Axiol / .bash_profile
Last active Dec 23, 2015
My bash config
View .bash_profile
alias ls="ls -G"
alias please="sudo"
alias reload_profile=". ~/.bash_profile"
alias gits="git status"
alias gita="git add ."
alias gitc="git commit -am"
alias fuck="sudo $(history -p \!\!)"
# ANSI color codes
RS="\[\033[0m\]" # reset
@Axiol
Axiol / database.php
Last active Dec 10, 2015
Use multiple database configuration depending of the adress you access the service
View database.php
<?php
public $local = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => '',
'login' => '',
'password' => '',
'database' => '',
'prefix' => '',
'encoding' => '',
@Axiol
Axiol / script.js
Created Nov 21, 2012
Preview the image from an input file
View script.js
// Call this function on the onchange event of the input
function prevVisu(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function(e){
$("div#visuForm").html("<img class='img-polaroid' src='" + e.target.result + "' alt='Preview du visuel'>");
};
reader.readAsDataURL(input.files[0]);
}
}