This file contains 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
cat $FILE | sort --random-sort | head -n 1 | |
# alternatively | |
rl -c 1 -n src/main/resources/and-feb10.csv |
This file contains 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
$ uniq -d <file> | |
or | |
$ uniq -D <file> | |
Reference Link : http://www.thegeekstuff.com/2013/05/uniq-command-examples/ |
This file contains 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
[alias] | |
amend = commit --amend -a | |
br = branch | |
co = checkout | |
ds = diff --staged | |
di = diff | |
fetchall = fetch -v --all | |
log-fancy = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(cyan)<%an>%Creset' --abbrev-commit --date=relative | |
# With git >= 1.8.3 you can use %C(auto) for the branch decorator (%d) | |
log-fancy = log --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(cyan)<%an>%Creset' --abbrev-commit --date=relative |
This file contains 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
Check that your official nvidia driver is running properly on linux : | |
lspci -vnn | grep -i VGA -A 12 | |
glxinfo | grep OpenGL | grep renderer | |
grep 'nouveau' /etc/modprobe.d/* | grep nvidia | |
lsmod | grep nvidia | |
modprobe -R nvidia | |
modinfo nvidia_<N> |
This file contains 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
[sudo] debugfs -R 'stat <inode>' /dev/<device_name> |
This file contains 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
// by Erik Wrenholt | |
import java.util.*; | |
class Mandelbrot | |
{ | |
static int BAILOUT = 16; | |
static int MAX_ITERATIONS = 1000; | |
private static int iterate(float x, float y) | |
{ |
This file contains 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
// Lack of tail call optimization in JS | |
var sum = function(x, y) { | |
return y > 0 ? sum(x + 1, y - 1) : | |
y < 0 ? sum(x - 1, y + 1) : | |
x | |
} | |
sum(20, 100000) // => RangeError: Maximum call stack size exceeded | |
// Using workaround |
This file contains 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
npm update -S |
This file contains 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
# init a python project | |
pip install virtualenv | |
virtualenv --distribute <venv_dirname> | |
source <venv_dirname>/bin/activate | |
# install dependencies | |
pip install -r requirements.txt | |
# exit virtualenv mode | |
deactivate |
OlderNewer