Skip to content

Instantly share code, notes, and snippets.

@speto
speto / install-quake3+cpma.sh
Last active May 17, 2024 15:27 — forked from nikhilmetrani/install-quake3+cpma.sh
Install Quake 3: Arena + CPMA on a mac
#!/bin/bash
# Install Quake 3: Arena on a mac
# Copyright (c) 2016 simonewebdesign
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
@speto
speto / git-deletebranches.sh
Last active August 14, 2017 12:47 — forked from zasadnyy/git-deletebranches.sh
Git Delete Merged Branches
#!/bin/bash
MAIN=master
BRANCHES=$(git branch --merged $MAIN | grep -v -e 'master\|staging\|develop\|\*')
echo Branches merged into $MAIN:
echo $BRANCHES | tr " " "\n"
read -p "Delete these branches (y/n)? " answer
@speto
speto / uri.js
Last active August 29, 2015 14:20 — forked from jlong/uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@speto
speto / grep.sh
Last active August 29, 2015 14:17 — forked from NapoleonWils0n/grep.sh
pbpaste | grep -o 'http://[^"]*'
The Python 2.7 documentation recommends the use of cProfile to profile Python code with reasonnably low overhead: https://docs.python.org/release/2.7/library/profile.html
If you use virtualenv, dont forget to activate it:
$ . bin/activate
How do you launch your script with cProfile enabled ?
$ python -m cProfile -o run.profile myscript.py
The output file (run.profile) will be generated when the execution terminates (including CTRL-C).