Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Istvan l1x

🏠
Working from home
Block or report user

Report or block l1x

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@l1x
l1x / athena_size_time_statistics.sh
Last active Sep 17, 2019
One liner to print out runtime statistics for the last N Athena queries
View athena_size_time_statistics.sh
export PROFILE=foxi-maxi
export REGION=eu-west-1
aws --region $REGION --profile $PROFILE athena list-query-executions --max-items 10 \
| jq '.QueryExecutionIds[]' \
| xargs -I {} aws --region $REGION --profile $PROFILE athena get-query-execution --query-execution-id {} \
| jq '.QueryExecution.Statistics'
@l1x
l1x / merge.parquet.py
Last active Sep 10, 2019
Merging Parquet files with Python
View merge.parquet.py
import os
import pyarrow.parquet as pq
#
# Warning!!!
# Suffers from the same problem as the parquet-tools merge function
#
#parquet-tools merge:
#Merges multiple Parquet files into one. The command doesn't merge row groups,
#just places one after the other. When used to merge many small files, the
@l1x
l1x / python.wat.moments.py
Created Sep 10, 2019
Wat moments while coding in Python
View python.wat.moments.py
# nope
for folder in "state/" "logs/":
print(folder)
# nope #2
for folder in [ "state/" "logs/" ]:
print(folder)
# yes
for folder in "state/", "logs/":
print(folder)
@l1x
l1x / git_alias.ps
Created May 29, 2019
Git aliases for PowerShell
View git_alias.ps
function gpom { git pull origin master }
Set-Alias -Name pull -Value gpom
function gpod { git pull origin develop }
Set-Alias -Name gpod -Value gpod
@l1x
l1x / python.install.alpine.linux.sh
Last active May 7, 2019
Installing Python on Alpine
View python.install.alpine.linux.sh
sudo apk add libffi-dev openssl-dev python2-dev musl-dev gcc py2-pip make cmake
pip install --user aws
View risp-2.0.rs
use std::collections::HashMap;
use std::io;
use std::num::ParseFloatError;
use std::rc::Rc;
//
// Types
//
#[derive(Clone)]
@l1x
l1x / fish.prompt.sh
Last active May 2, 2019
Set up Fish shell prompt with tilde for home
View fish.prompt.sh
function fish_prompt
set -g __branch \((git branch ^/dev/null | grep \* | sed 's/* //')\)
if test "$__branch = master"
set -g __git_prompt (set_color cyan)$__branch(set_color normal)
else
set -g __git_prompt (set_color orange)$__branch(set_color normal)
end
if test "$PWD" != "$HOME"
printf "%s %s > " (echo $PWD|sed -e 's|/private||' -e "s|^$HOME|~|") $__git_prompt
View tmux.conf
set -g prefix C-a
unbind C-b
bind C-a send-prefix
setw -g mode-keys vi
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
View rocksdb.options.example.ini
# This is a RocksDB option file.
#
# For detailed file format spec, please refer to the example file
# in examples/rocksdb_option_file_example.ini
#
[Version]
rocksdb_version=5.18.3
options_file_version=1.1
You can’t perform that action at this time.