Skip to content

Instantly share code, notes, and snippets.

@matiasherranz
matiasherranz / gist:6693320
Created September 25, 2013 00:32
Python madness
[matias@MacBookPro]:~$ python
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> def f():
... print 'f()'
...
>>> def g():
... print 'g()'
...
# Let's create a list with duplicated elements:
ls = [1,1,1,2,2,1,5,4,3,2,1]
# And let's now remove them in just one line:
l2 = list(set(ls))
# See the result:
@matiasherranz
matiasherranz / gist:6832433
Created October 4, 2013 20:45
Mac OS Beep
beep() {
$@ && afplay /System/Library/Sounds/Glass.aiff || afplay /System/Library/Sounds/Blow.aiff
}
@matiasherranz
matiasherranz / gist:6832420
Created October 4, 2013 20:44
Ubuntu Beep
beep() {
$@ && paplay /usr/share/sounds/gnome/default/alerts/glass.ogg || paplay /usr/share/sounds/alsa/Noise.wav
}
git config --global alias.conflicts "diff --name-only --diff-filter=U"
diff --name-only --diff-filter=U
git conflicts
{
"Working Directory" : "\/Users\/matiasherranz",
"Prompt Before Closing 2" : 0,
"Selected Text Color" : {
"Green Component" : 0.8470588,
"Blue Component" : 0.4784314,
"Red Component" : 0.7607843
},
"Rows" : 25,
"Ansi 11 Color" : {
# Let's move to the proper GIT branch
git checkout $BRANCH
git pull origin $BRANCH
# Let's go to the correct folder
cd converter
# Install the dependencies
npm install