Skip to content

Instantly share code, notes, and snippets.

View gonzaloserrano's full-sized avatar
☁️
🧑‍💻

Gonzalo Serrano gonzaloserrano

☁️
🧑‍💻
View GitHub Profile
@gonzaloserrano
gonzaloserrano / git-web
Created October 1, 2013 10:08
Open current git directory in github (branch compatible)
# /bin/bash
# Opens the github page for the current git repository in your browser
# https://github.com/jasonneylon/dotfiles/
giturl=$(git config --get remote.origin.url)
if [ "$giturl" == "" ]
then
echo "Not a git repository or no remote.origin.url set"
exit 1;
@gonzaloserrano
gonzaloserrano / git-tagg
Created October 1, 2013 14:03
Show last 3 git tags plus last tag message
#!/bin/sh
git for-each-ref \
--format='%(taggerdate:iso8601) %(refname:short)' refs/tags |
grep -v '^ ' |
sort |
cut -d' ' -f4- |
tail -n 3
git lgg | head -n 1 | awk -F '=> ' '{print " "$2}'
@gonzaloserrano
gonzaloserrano / wifi_ip
Created February 7, 2014 14:37
Prints Macbook pro's wifi ip
#! /bin/sh
ifconfig | grep en1: -A 2 | tail -n 1 | awk '{print $2}'
gonzalo@tribe ~ $ brew install https://raw.github.com/MSch/homebrew/master/Library/Formula/wxmac.rb --disable-monolithic
######################################################################## 100.0%
==> Downloading http://downloads.sourceforge.net/project/wxpython/wxPython/2.9.5.0/wxPython-src-2.9.5.0.tar.bz2
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/wxmac/2.9.5.0 --enable-shared --enable-unicode --enable-std_string --enable-display
==> make install
Warning: Formula#python is deprecated and will go away shortly.
Warning: Formula#python is deprecated and will go away shortly.
==> python setup.py build_ext WXPORT=osx_cocoa WX_CONFIG=/usr/local/Cellar/wxmac/2.9.5.0/bin/wx-config UNICODE=1 INSTALL_MULTI
/usr/local/Cellar/wxmac/2.9.5.0/include/wx-2.9/wx/strvararg.h:26:14: fatal error: 'type_traits' file not found
#! /bin/sh
TMPPATH='/tmp/jsons'
if [ $2 ]
then
scp jh1:~/$1/src/SP/JurassicHunter/Resources/Configuration/data/$2.json $TMPPATH/$2_$1.json
scp jh1:~/$1/src/SP/JurassicHunter/Resources/Configuration/metadata/$2.json $TMPPATH/$2_metadata_$1.json
else
rm -rf $TMPPATH/$1
mkdir -p $TMPPATH/$1
@gonzaloserrano
gonzaloserrano / gist:8f9841fe0c364b0e67d1
Last active August 29, 2015 14:07
Trello CSS tunning for Week tasks
.list {
flex: 0 0 200px;
}
.list:first-child {
flex: 0 0 250px;
background: #D2CEE6;
}
.list:nth-last-child(3) {
gonzalo@tribe $ brew reinstall --build-from-source --cc=gcc-4.9 boost gflags glog
==> Reinstalling boost
==> Downloading https://downloads.sourceforge.net/project/boost/boost/1.56.0/boost_1_56_0.tar.bz2
Already downloaded: /Library/Caches/Homebrew/boost-1.56.0.tar.bz2
==> ./bootstrap.sh --prefix=/usr/local/Cellar/boost/1.56.0 --libdir=/usr/local/Cellar/boost/1.56.0/lib --without-icu --without
==> ./b2 --prefix=/usr/local/Cellar/boost/1.56.0 --libdir=/usr/local/Cellar/boost/1.56.0/lib -d2 -j4 --layout=tagged --user-co
🍺 /usr/local/Cellar/boost/1.56.0: 10471 files, 526M, built in 18.3 minutes
==> Reinstalling gflags
==> Downloading https://gflags.googlecode.com/files/gflags-2.0.tar.gz
@gonzaloserrano
gonzaloserrano / gist:ca4c3ab2298aa72f1454
Created December 4, 2014 16:03
readable debug_backtrace
$callStack = rtrim(array_reduce(
array_reverse(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)),
function ($result, $call) {
return $result .= (isset($call['class']) ? $call['class'] . ':' : '') . $call['function'] . ' -> ';
}
), ' -> ') . "\n";
local cache_key = KEYS[1]
redis.log(redis.LOG_NOTICE, type(KEYS))
redis.log(redis.LOG_NOTICE, KEYS[1])
redis.log(redis.LOG_NOTICE, KEYS[2])
for key in KEYS do
redis.log(redis.LOG_NOTICE, "here")
redis.log(redis.LOG_NOTICE, key)
end
@gonzaloserrano
gonzaloserrano / gist:e3cd6a4307b7d9c8e26c
Last active August 29, 2015 14:13
phpredis reconnection failing test
<?php
// redis docker containers
$serversList = array(
'redis1',
'redis2',
'redis3',
'redis4',
'redis5',
);