Skip to content

Instantly share code, notes, and snippets.

Avatar

Steven Vo stevenvo

View GitHub Profile
@stevenvo
stevenvo / struct.go
Last active Jul 27, 2020
Struct #go #struct
View struct.go
// Definition
type identifier struct {
field1 type1
field2 type2
...
}
// Example struct defintion for use below
type struct1 struct { // struct definition
i1 int
@stevenvo
stevenvo / s3_cp.sh
Created Jun 19, 2019
Download file from S3 - Recursive, include/exclude patterns
View s3_cp.sh
aws s3 cp s3://<bucket_name> <local_folder>/ --recursive --exclude "*" --include "*201906*json" --include "*201906*pColdStart*" --exclude "*baseline*" --exclude "*candidate*"
@stevenvo
stevenvo / jasonette.json
Last active May 31, 2019
jasonette.json
View jasonette.json
{
"$jason": {
"head": {
"title": "{ ˃̵̑ᴥ˂̵̑}",
"actions": {
"$foreground": {
"type": "$reload"
}
}
},
@stevenvo
stevenvo / git.cmd
Last active Jan 28, 2018
Useful Git Command
View git.cmd
# Pulling a git repository as a git module into your project
# "master" is the branch of the remote repository to use
git submodule add -b master https://github.com/Komodo/trackchanges.git src/modules/trackchanges
# get status recursively
git submodule status --recursive
# Iterate through all git submodule to add and comment and commit
@stevenvo
stevenvo / sql.sql
Last active Jan 29, 2018
Database Useful SQLs
View sql.sql
-- Redshift - Query usage --
select
sum(capacity)/1024 as capacity_gbytes,
sum(used)/1024 as used_gbytes,
(sum(capacity) - sum(used))/1024 as free_gbytes
from
stv_partitions where part_begin=0;
-- usage by tables --
@stevenvo
stevenvo / .gitignore
Created Oct 24, 2017
Python .gitignore
View .gitignore
*.DS_Store
*.pyc
@stevenvo
stevenvo / xz.sh
Last active Oct 22, 2017
uncompress xz file
View xz.sh
$ brew install xz
$ xz -d to-extract.xz
View gist:f34ff09f089584dabe85af3b5bc1583f
brew install imagemagick@6
brew link --force imagemagick@6
bundle install rmagick
View claymore.stub.conf
-colors 4
-dbg -1
-gser 2
-fanmin 55
-tt 70
-ttli 75
-r 1
-erate 1
-estale 1
-etha 0
@stevenvo
stevenvo / useful_python_snippets.py
Last active Jan 13, 2018
Useful python snippets
View useful_python_snippets.py
#############################################################################
# Generate Dict from a List of Dict
ticker = [
{
'symbol': 'ABC',
'price': 100.0
},
{
'symbol': 'CDE',
'price': 105.0