Skip to content

Instantly share code, notes, and snippets.

View AkdM's full-sized avatar
👋

Anthony Da Mota AkdM

👋
View GitHub Profile
@AkdM
AkdM / description.md
Last active March 17, 2017 14:22
JSONView Theme

#JSONView Theme

Preview

JSONView Theme preview

@AkdM
AkdM / Use config only.md
Created September 21, 2016 11:31
Don't guess my identity! - git

Now you can tell Git not to guess committer identity, but rather to insist that you set user.name and user.email explicitly before it will let you commit:

git config --global user.useconfigonly true

@AkdM
AkdM / hive.sql
Last active October 20, 2016 17:33
Hive
-- Create names table
CREATE TABLE names(
name STRING,
gender Array<String>,
origin Array<String>,
version DOUBLE
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\073'
COLLECTION ITEMS TERMINATED BY ',';
@AkdM
AkdM / cloudflare_check.sh
Created February 25, 2017 21:35
Not-perfect-at-all bash script to check if websites use Cloudflare (Cloudbleed) by providing a list
#!/bin/bash
#
# To use:
# ./cloudflare_check.sh list.csv
# ./cloudflare_check.sh urls.txt
#
# I made this to check my 1Password logins.
# You can export all of your logins by going into
# File > Export > All Items
# http://i.imgur.com/orMuAob.jpg
@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")
}
}