Skip to content

Instantly share code, notes, and snippets.

View claudioc's full-sized avatar

Claudio Cicali claudioc

View GitHub Profile
#!/bin/bash
MY_S=( )
main() {
local current
local branch=${1}
local branches
local idx=0
@claudioc
claudioc / gist:4188239
Created December 2, 2012 11:08
Roman <=> Integer (Ruby)
module RomanEmpire
emperor = "Claudio Cicali"
@numbers = {
:letters => [ "M", "D", "C", "L", "X", "V", "I" ],
:integers => [ "1000", "500", "100", "50", "10", "5", "1" ]
}
def RomanEmpire.romanFor(integer)
@claudioc
claudioc / gist:4188260
Created December 2, 2012 11:16
Roman <=> Integer (JavaScript)
var RomanEmpire = {
emperor: "Claudio Cicali",
numbers: {
letters: [ "M", "D", "C", "L", "X", "V", "I" ],
integers: [ "1000", "500", "100", "50", "10", "5", "1" ]
},
romanFor: function(integer) {
@claudioc
claudioc / gist:4203288
Created December 4, 2012 12:26
roman to arabic onliner
$map = ["1","I","2","II","3","III","4","IV","5","V","6","VI","7","VII","8","VIII","9","IX","10","X","11","XI","12","XII","13","XIII","14","XIV","15","XV","16","XVI","17","XVII","18","XVIII","19","XIX","20","XX","21","XXI","22","XXII","23","XXIII","24","XXIV","25","XXV","26","XXVI","27","XXVII","28","XXVIII","29","XXIX","30","XXX","31","XXXI","32","XXXII","33","XXXIII","34","XXXIV","35","XXXV","36","XXXVI","37","XXXVII","38","XXXVIII","39","XXXIX","40","XL","41","XLI","42","XLII","43","XLIII","44","XLIV","45","XLV","46","XLVI","47","XLVII","48","XLVIII","49","XLIX","50","L","51","LI","52","LII","53","LIII","54","LIV","55","LV","56","LVI","57","LVII","58","LVIII","59","LIX","60","LX","61","LXI","62","LXII","63","LXIII","64","LXIV","65","LXV","66","LXVI","67","LXVII","68","LXVIII","69","LXIX","70","LXX","71","LXXI","72","LXXII","73","LXXIII","74","LXXIV","75","LXXV","76","LXXVI","77","LXXVII","78","LXXVIII","79","LXXIX","80","LXXX","81","LXXXI","82","LXXXII","83","LXXXIII","84","LXXXIV","85","LXXXV","86","LXXXVI
@claudioc
claudioc / gist:5546590
Created May 9, 2013 09:42
[DSL O2] How to remove the redirection to o2suchedns.aol.de and make it point to Google
# Put this line in your /etc/hosts
127.0.0.1 o2suchedns.aol.de
# Create a VirtualHost like this and restart Apache
<VirtualHost *:80>
ServerName o2suchedns.aol.de
RewriteEngine On
RewriteCond %{QUERY_STRING} query=(.*)
RewriteRule ^aol/afe_x$ https://www.google.com/search?q=%1 [L]
</VirtualHost>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
======================================================================
Tron
======================================================================
A Sublime Text 2 / Textmate theme.
Copyright (c) 2012 Dayle Rees.
Released under the MIT License <http://opensource.org/licenses/MIT>
======================================================================
{
// Details: https://github.com/victorporof/Sublime-JSHint#using-your-own-jshintrc-options
// Example: https://github.com/jshint/jshint/blob/master/examples/.jshintrc
// Documentation: http://www.jshint.com/docs/
"browser": true,
"jquery": true,
"node": true,
"esnext": false,
"globals": {},
"laxcomma": true,
@claudioc
claudioc / gist:82f36dba4f74a4ebd858
Created October 22, 2014 14:47
Easy pull request (needs hub)
#!/bin/bash
B=$(git rev-parse --abbrev-ref HEAD)
M=$(git log -n1 --format=format:%s)
DEF_TITLE="${M} - ${B}"
read -e -p "Provide the issue number: " ISSUEN
read -e -p "Provide a meaningful title [${DEF_TITLE}]: " TITLE
TITLE="${TITLE:-$DEF_TITLE}"
echo
echo hub pull-request -m \"${ISSUEN} ${TITLE}\" -h claudioc:${B}
@claudioc
claudioc / gist:3e84baa01d6dcf2e39f4
Created October 22, 2014 14:49
Easy pull request (needs hub)
#!/bin/bash
B=$(git rev-parse --abbrev-ref HEAD)
M=$(git log -n1 --format=format:%s)
DEF_TITLE="${M} - ${B}"
read -e -p "Provide the issue number: " ISSUEN
read -e -p "Provide a meaningful title [${DEF_TITLE}]: " TITLE
TITLE="${TITLE:-$DEF_TITLE}"
echo
echo hub pull-request -m \"${ISSUEN} ${TITLE}\" -h claudioc:${B}
@claudioc
claudioc / gist:5114554f68e5a026c26d
Created October 22, 2014 14:50
Easy pull request (needs hub)
#!/bin/bash
B=$(git rev-parse --abbrev-ref HEAD)
M=$(git log -n1 --format=format:%s)
DEF_TITLE="${M} - ${B}"
read -e -p "Provide the issue number: " ISSUEN
read -e -p "Provide a meaningful title [${DEF_TITLE}]: " TITLE
TITLE="${TITLE:-$DEF_TITLE}"
echo
echo hub pull-request -m \"${ISSUEN} ${TITLE}\" -h claudioc:${B}