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
echo "symbol,name,exchange,avg_price,shares,book_value,currency" > file.csv | |
jq -r ".results[] | select(.active) | [ \ | |
.stock.symbol, \ | |
.stock.name, \ | |
.stock.primary_exchange, \ | |
(.book_value.amount / .quantity), \ | |
.quantity, \ | |
.book_value.amount, \ | |
.currency \ | |
] | @csv" positions.json >> file.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
#include <stdio.h> | |
void zeros_to_end(int arr[], int len) { | |
int count = 0; | |
int *p = arr; | |
int *end_arr = p + len; | |
for (; p <= end_arr; ) { | |
if (*p == 0) count++; | |
else *(p - count) = *p; |
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
# List Subnets | |
aws ec2 describe-subnets | jq ".Subnets[] | \"\(.CidrBlock) \(.SubnetId)\" " | |
# List Keypairs | |
aws ec2 describe-key-pairs | |
# List VPCs | |
aws ec2 describe-vpcs |
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
export GOPATH=$(pwd) | |
GIT_TERMINAL_PROMPT=1 go get -d github.com/libgit2/git2go | |
cd $GOPATH/src/github.com/libgit2/git2go | |
git checkout next | |
git submodule update --init # get libgit2 | |
make install |
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
cd ~/share | |
git clone https://github.com/neovim/neovim.git | |
cd neovim | |
sudo dnf install -y libtool libtool-ltdl-devel libvterm-devel | |
make | |
sudo make install |
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
sqlite3 places.sqlite .schema > data.sql && sqlite3 places.sqlite .dump >> data.sql |
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
# https://www.hackerrank.com/challenges/cube-summation | |
# This is the _inoptimal_ solution. The proper solution is Fenwick Trees as detailed in the Editorial | |
# This has a better average, but same worst case than the straight foreward bruteforce solution | |
#!/usr/bin/env python | |
def assert_arg_count(argc, args): | |
assert len(args) == argc, ("args needs to be exactly %d was %d" % (argc, len(args))) |
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
snes9x-gtk -ntsc -paddev1 /dev/input/js0 -port1 pad1 | |
padsp snes9x -ntsc -paddev1 /dev/input/js0 -port1 pad1 |
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 OUTPUT='xrandr --output TV-1' | |
OUTPUT --off | |
OUTPUT --set mode NTSC-M | |
OUTPUT --set overscan 0 | |
OUTPUT --set "flicker reduction" 0 | |
OUTPUT --transform 1.0,0,0,0,1.0,0,0,0,1 | |
OUTPUT --auto | |
OUTPUT --Left-of DVI-I-1 | |
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 dnf remove -y vim-minimal | |
su -c 'dnf install -y vim-common' | |
su -c 'dnf install -y sudo' | |
sudo dnf install -y git tmux zsh nginx vim | |
sudo rpm -ivh "https://downloads.plex.tv/plex-media-server/0.9.16.6.1993-5089475/plexmediaserver-0.9.16.6.1993-5089475.x86_64.rpm" | |
NewerOlder