This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git filter-branch -f --index-filter "git rm -r --cached --ignore-unmatch file1 file2 dir1 dir2" --prune-empty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // this can be loaded via browser console with | |
| // var script=document.createElement('script'); script.type='text/javascript'; script.src='http://quicksort.altervista.org/SnackOverflow/js/SnackOverflowLiveMap.js'; document.head.appendChild(script); | |
| var vehicleName; | |
| var vehicleStats = [ | |
| {last: "10/08/2016 - 80€", level: "12%"}, | |
| {last: "13/08/2016 - 65€", level: "70%"}, | |
| {last: "14/08/2016 - 76€", level: "85%"}, | |
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir subdir-fork | |
| cd subdir-fork | |
| git clone git@github.com:sbebo/REPO.git | |
| git filter-branch --prune-empty --subdirectory-filter <SUBFOLDER> master | |
| git remote -v | |
| git remote rm origin | |
| git remote add origin git@github.com:sbebo/<NEWREPO>.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| + iterm: VIM or SSH scrollback buffer is preserved? --> Uncheck "Save lines to scrollback in alternate screen mode" | |
| + ipython/jupyter: if installed via anaconda, it is not a "framework", so the osx backend in matplotlib works badly (keyboard highlight stays on the notebook). it's better to use qt, at least it works. | |
| + SCIP/SCIP.jl: to have a .dylib, just rename the .so file to .dylib | |
| + slow text cursor (repeat interval): system preferences -> keyboard -> key repeat | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #variables | |
| :'<,'>s/@defVar(m, /var /g | |
| :'<,'>s/)/;/g | |
| :'<,'>s/\[/{/g | |
| :'<,'>s/\]/}/g | |
| #contraints | |
| :'<,'>s/@addConstraint(m, /subject to /g | |
| :'<,'>s/)\n/;\r/g |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| conda skeleton pypi #package# | |
| conda build #package# | |
| conda install --use-local #package# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ssh -N -f -L localhost:9999:localhost:8888 username@remot-host.xxx.it | |
| #tunnel via port 9999 to port 8888 on remote host. useful, e.g., for ipython notebooks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module LPTest | |
| using JuMP | |
| using CPLEX, Gurobi | |
| function gen_data(M, N) | |
| srand(3) | |
| println("Generating data..") | |
| p = max(randn(N),0) | |
| A = max(randn(M,N),0) | |
| b = abs(randn(M)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir /tmp/mergepatchs | |
| cd ~/repo/org | |
| export reposrc=myfile.c #or mydir | |
| git format-patch -o /tmp/mergepatchs $(git log $reposrc|grep ^commit|tail -1|awk '{print $2}')^..HEAD $reposrc | |
| cd ~/repo/dest | |
| git am /tmp/mergepatchs/*.patch |
NewerOlder