Skip to content

Instantly share code, notes, and snippets.

View olih's full-sized avatar

Olivier Huin olih

View GitHub Profile
@olih
olih / zsh-alias-git.sh
Created March 17, 2015 16:29
Helpful aliases for git for zsh when using a rebase workflow
#GIT Alias
alias latest='git checkout master;git fetch --all;git rebase;git status;'
alias br='git show-branch;git branch;git status;'
alias h2='git rebase -i HEAD~2'
alias h3='git rebase -i HEAD~3'
alias h4='git rebase -i HEAD~4'
alias h5='git rebase -i HEAD~5'
alias h6='git rebase -i HEAD~6'
@olih
olih / 4xx.md
Last active December 23, 2015 08:29
Http 4xx Error Status summary
method path header query,entity status description
- - - Any 400 Bad Request The request could not be understood by the server due to malformed syntax
- - Any Any 403 Forbidden The server understood the request, but is refusing to fulfill it
- Any - - 404 Not Found The server has not found anything matching the Request-URI
Any - - - 405 Method Not Allowed The method specified (GET, PUT...) in the Request-Line is not allowed for the resource
- - Any - 412 Precondition Failed The precondition given in one or more of the request-header fields evaluated to false
- - Any - 431 Request Header Fields Too Large (RFC 6585) The server is unwilling to process the the header fields are too large.
- - - Any 413 Request Entity Too Large The server is refusing to process a request because the request entity is too large
- - - Any 414 Reques
@olih
olih / password.coffee
Created August 14, 2013 11:09
Generate a random password for admin purposes
#
#Creator: 2013, Olivier Huin (https://github.com/olih)
#License: Eclipse Public License - v 1.0
#Contributors:
#
# Generates a random password
#This code is a quick hack and should not be used for production
#as it is not optimized and the random numbers could be predicted.
G=10000000000
@olih
olih / ps.py
Created August 9, 2013 14:08
List all the linux/MacOs processes (ps -A) Kill all the processes with a given name
#!/usr/bin/env python
# encoding: utf-8
"""
Executes a ps
Kill all processes with a given name
Creator: 2013, Olivier Huin (https://github.com/olih)
License: Eclipse Public License - v 1.0
Contributors:
"""
@olih
olih / adwords.py
Last active December 20, 2015 18:18
Analysis of adwords
#!/usr/bin/python
#
#Creator: 2013, Olivier Huin (https://github.com/olih)
#License: Eclipse Public License - v 1.0
#Contributors:
#
import sys, getopt
import csv
@olih
olih / convert.coffee
Created August 6, 2013 16:23
A few examples of simple conversions
#
#Creator: 2013, Olivier Huin (https://github.com/olih)
#License: Eclipse Public License - v 1.0
#Contributors:
#
pairToMap= (key,value)->
row=
Name: key
Value: value
@olih
olih / id.coffee
Created August 6, 2013 14:21
Generate numeric ids
#
#Creator: 2013, Olivier Huin (https://github.com/olih)
#License: Eclipse Public License - v 1.0
#Contributors:
#
#This code is a quick hack and should not be used for production
#as it is not optimized and the random numbers could be predicted.
@olih
olih / pageviewcost.coffee
Created July 31, 2013 15:37
Basic calculation of cost/revenue by page viewed
#
#Creator: 2013, Olivier Huin (https://github.com/olih)
#License: Eclipse Public License - v 1.0
#Contributors:
#
#Very basic page view cost calculator
#Dollar conversion
D= 0.65
@olih
olih / LibraryReview.md
Last active December 19, 2015 01:39
Key elements for reviewing a library
  • name
  • description
  • version
  • keywords
  • homepage
  • author
  • repository
  • licenses
  • stars
  • updated
@olih
olih / alias_tar.sh
Created May 23, 2013 11:30
Create a tar or tar.gz archive with a date using the ISO 8601 format. 1. Install the functions with your aliases (ex: .bash_profile MacOS) 2. Usage: tard folder tarzd folder
function tard { tar cvf $1-$(date +%Y-%m-%dT%H:%MZ).tar $1;}
export tard
function tarzd { tar cvfz $1-$(date +%Y-%m-%dT%H:%MZ).tar.gz $1;}
export tarzd