Skip to content

Instantly share code, notes, and snippets.

View AkdM's full-sized avatar
👋

Anthony Da Mota AkdM

👋
View GitHub Profile
@AkdM
AkdM / SeaShell.itermcolors
Created July 4, 2017 09:48
iTerm3 Custom SeaShell colors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.37254902720451355</real>
@AkdM
AkdM / .zshrc
Created July 4, 2017 09:50
ZSH Theme configuration (.zshrc file)
ZSH_THEME="bullet-train"
BULLETTRAIN_PROMPT_CHAR=""
BULLETTRAIN_DIR_EXTENDED=2
BULLETTRAIN_NVM_SHOW=true
BULLETTRAIN_EXEC_TIME_SHOW=false
BULLETTRAIN_EXEC_TIME_BG="yellow"
BULLETTRAIN_EXEC_TIME_FG="black"
BULLETTRAIN_VIRTUALENV_FG="black"
@AkdM
AkdM / SeaShell.itermcolors
Created September 16, 2017 00:41
SeaShell
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.37254902720451355</real>
@AkdM
AkdM / remove_columns.py
Last active October 24, 2017 14:45
Remove Columns of a CSV with PANDAS
import pandas as pd
input_file = "input.csv"
output_file = "output.csv"
sep = ";"
columns = ["column1", "column2", "anotherone"]
df = pd.DataFrame.from_csv(input_file, sep=sep)
df.drop(df[columns], axis=1, inplace=True)
df.to_csv(output_file, sep=sep)
@AkdM
AkdM / find_columns.py
Created October 24, 2017 15:32
Find columns on CSV with PANDAS
import pandas as pd
input_file = "input.csv"
output_file = "output_find.csv"
sep = ";"
df = pd.DataFrame.from_csv(input_file, sep=sep)
column1 = df['one'] > 123
column2 = df['two'] == "something"
@AkdM
AkdM / iPhoneXDetected.swift
Created October 27, 2017 09:09
Detecting iPhone X
if #available(iOS 11.0, *) {
if (UIApplication.shared.keyWindow?.safeAreaInsets != UIEdgeInsets.zero) {
print("I am an iPhone X")
}
}
@AkdM
AkdM / record.sh
Created November 22, 2017 17:33
Record iOS simulator video
xcrun simctl io booted recordVideo filename.mov
@AkdM
AkdM / userChrome.css
Created March 13, 2018 22:08
Partially fixes the GPU and CPU throttle on Firefox with Retina scaled up resolution
.tab-throbber[busy]::before {
background-image: url("chrome://global/skin/icons/loading.png") !important;
animation: none !important;
}
.tab-throbber[busy]:not([progress])::before {
/* Grays the blue during "Connecting" state */
filter: grayscale(100%);
}
@AkdM
AkdM / bind_port_locally.md
Last active March 23, 2018 01:11
Bind port from SSH locally

If you want to bind the port 19999 (netdata default port for instance) to port 12345:

ssh -N -L 12345:localhost:19999 $SSH_USER@$SSH_IP -p $SSH_PORT

If you need to execute it in background, simply add the -f flag:

ssh -fN -L 12345:localhost:19999 $SSH_USER@$SSH_IP -p $SSH_PORT

then kill it with kill -9 $PID

@AkdM
AkdM / mbp_poweroff_fix.md
Last active March 23, 2018 10:26
Fix MBP slow waking + slow running after poweredoff after sleep

I suspect Filevault from slowering everything btw.

Set to 3 days (259,200 seconds), but I guess you can totally disable it by setting it to 0:

pmset -a autopoweroffdelay 259200