Skip to content

Instantly share code, notes, and snippets.

@adidonato
adidonato / compose_apple_mail.sh
Created September 7, 2015 13:45
Mac osx: Send files via email using Mail.app from the terminal
#!/bin/bash
###################################################################
# usage: ./compose_apple_mail.sh 'address' 'Subject' path_to_file #
# no arguments are compulsory #
###################################################################
echo "tell application \"Mail\"
activate
#!/usr/local/bin/blue-python2.7
"""
TESTED WITH:
array = np.random.random(10)
value = 0.5
WHICH RESULTED IN:
@adidonato
adidonato / useful_pandas_snippets.py
Created November 5, 2015 17:16 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
#List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
#Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
#Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(value_list)]

Keybase proof

I hereby claim:

  • I am adidonato on github.
  • I am adidonato (https://keybase.io/adidonato) on keybase.
  • I have a public key ASD1aLEnE7kEjcIryUo-gzc0K715sfuf16KH7rzvKm9f7wo

To claim this, I am signing this object:

@adidonato
adidonato / .block
Created October 13, 2018 09:47 — forked from mbostock/.block
Hierarchical Edge Bundling
license: gpl-3.0
height: 960
border: no
@adidonato
adidonato / prices
Last active November 16, 2018 14:44
2018-11-15,144.05,144.89,129.83,138.44,208017000.00,1169319667.00
2018-11-14,160.74,162.49,138.04,143.65,153849000.00,1213070013.00
2018-11-13,163.01,164.42,159.37,161.17,155883000.00,1360714704.00
2018-11-12,160.24,167.30,159.89,163.05,198078000.00,1376230076.00
2018-11-11,161.77,162.24,158.42,160.11,317344000.00,1350880369.00
2018-11-10,159.96,163.90,158.69,161.72,320383000.00,1364443572.00
2018-11-09,164.16,165.21,159.58,159.99,210843000.00,1349561475.00
2018-11-08,166.25,174.02,164.29,164.29,139714000.00,1385511418.00
2018-11-07,170.12,171.32,164.27,166.45,190695000.00,1403421907.00
2018-11-06,164.86,172.42,163.99,170.47,167367000.00,1428094259.00
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# set window split
bind-key v split-window -h
bind-key b split-window
# default window title colors
@adidonato
adidonato / split-branch.sh
Created June 18, 2019 11:16
split git branches
git checkout -b <BRANCH-NAME-NEW> start^
for commit in $(git rev-list --reverse <start-sha-commit>..<end-sha-commit>); do
git checkout $commit -- ((LIST OF FILES TO BRANCH OUT))
git commit -C $commit
done(base)
#!/bin/bash
function post_to_slack () {
# format message as a code block ```${msg}```
SLACK_MESSAGE="\`\`\`$1\`\`\`"
SLACK_URL= # [URL of The Channel you want to post to]
case "$2" in
INFO)
SLACK_ICON=':slack:'
;;
WARNING)
#!/bin/sh
echo "Usage: ./show_last_updated_hive_table.sh #tablename"
time_column=`hive -e "show create table $1" | egrep "transient_lastDdlTime"`
time_value=`echo $time_column | sed 's/[|,)]//g' | awk -F '=' '{print $2}' | sed "s/'//g"`
tran_date=`date -d @$time_value +'%Y-%m-%d %H:%M:%S'`
echo $tran_date