Skip to content

Instantly share code, notes, and snippets.

View esavard's full-sized avatar

Etienne Savard esavard

View GitHub Profile
@esavard
esavard / ubuntu_devenv.sh
Created January 17, 2010 01:59
Ubuntu post installation script that setup a development environment using dialogs
#!/bin/bash
#===================================================================================
# ubuntu_devenv.sh
# http://symbiosoft.net/ubuntu_devenv
#
# (K)UBUNTU - POST INSTALLATION SCRIPT THAT SETUP A DEVELOPER ENVIRONMENT
#
# TODOLIST
#----------------------------------------------------------------------------------
# - Simulation (no changes)
@esavard
esavard / git_prompt.sh
Created May 27, 2010 14:30 — forked from martinos/git_prompt.sh
Git prompt
# ---------
# Prompt
# ---------
function gitprompt {
blue='\[\e[0;34;1m\]'
red='\[\e[0;38;1m\]'
green='\[\e[0;32;1m\]'
none='\[\e[0m\]'
prompt_info=""
@esavard
esavard / Git basic setup
Created July 2, 2010 14:06
Git basic setup
#Need some place to keep this...
git config --global user.name "Etienne Savard"
git config --global user.email savard.etienne@gmail.com
git config --global color.branch auto
git config --global color.diff auto
git config --global color.interactive auto
git config --global color.status auto
@esavard
esavard / exe_package.rb
Created July 8, 2010 04:35
exe_packager.rb : find all dependencies for a given EXE and package it in a zip file
# exe_packager.rb : find all dependencies for a given EXE and package it in
# a zip file
require 'csv'
require 'zip/zip'
require 'zippy'
ARGV.each do |exe_file|
short_filename = File.basename(exe_file, '.exe')
@esavard
esavard / gist:3658710
Created September 6, 2012 17:19
Generate random string in Python
import string
import random
size = 2500 # or whatever lenght you want your random string to be
allowed = string.ascii_letters # add any other allowed characters here
randomstring = ''.join([allowed[random.randint(0, len(allowed) - 1)] for x in xrange(size)])
print randomstring
def merge(first_id, second_id)
first = Article.find(first_id)
if Article.exists?(second_id)
second = Article.find(second_id)
else
false
end
#!/bin/bash
BACKUP_ROOT="$HOME/redmine_backup"
REDMINE_ROOT="/var/www/redmine"
BACKUP_FILENAME='backup_redmine_'`date +%Y%m%d`'.tar.bz2'
DB_DUMP_FILENAME='db_redmine_'`date +%Y%m%d`'.sqlc'
if [ ! -d "$BACKUP_ROOT" ]; then
mkdir $BACKUP_ROOT
fi
@esavard
esavard / calabash.groovy
Created June 29, 2013 21:16
Gradle plugin for calabash support in Android Studio
package com.mediaarc.gradle.plugins
import org.gradle.api.*
import org.gradle.api.plugins.*
import org.gradle.api.tasks.*
class CalabashPlugin implements Plugin<Project> {
void apply(Project project) {
project.extensions.create("calabash", CalabashPluginExtension)
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
/*
Buttondown
A Markdown/MultiMarkdown/Pandoc HTML output CSS stylesheet
Author: Ryan Gray
Date: 15 Feb 2011
Revised: 21 Feb 2012
General style is clean, with minimal re-definition of the defaults or
overrides of user font settings. The body text and header styles are
left alone except title, author and date classes are centered. A Pandoc TOC