This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" | |
"Hoyajigi Vim setting | |
"2009-02-09 | |
set autoindent | |
set cindent | |
set smartindent | |
set textwidth=76 | |
set wrap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Install Macports. | |
//Install aircrack-ng: | |
sudo port install aircrack-ng | |
//Install the latest Xcode, with the Command Line Tools. | |
//Create the following symlink: | |
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport | |
//Figure out which channel you need to sniff: | |
sudo airport -s | |
sudo airport en1 sniff [CHANNEL] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cat << EOF > /dev/null | |
# https://github.com/gpakosz/.tmux | |
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license, | |
# without any warranty. | |
# Copyright 2012— Gregory Pakosz (@gpakosz). | |
# /!\ do not edit this file | |
# instead, override settings in ~/.tmux.conf.local, see README.md | |
# -- general ------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def equalsWhenOneCharRemoved(x, y): | |
if abs(len(x) - len(y)) != 1: | |
return False | |
if len(x) > len(y): | |
x, y = y, x | |
i = padding = 0 | |
while i < len(x) and i + padding < len(y): | |
if x[i] == y[i + padding]: | |
i = i + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import pandas as pd | |
with open('input_p2.json') as json_file: | |
df = pd.DataFrame(json.loads(line) for line in json_file) | |
groupByProductId = df.groupby('product_id') | |
countOfDistinctUserId = groupByProductId['user_id'].nunique().sort_values() | |
print("Most popular product(s) based on the number of purchasers: ", | |
countOfDistinctUserId.loc[countOfDistinctUserId == countOfDistinctUserId.max()].index.tolist()) | |
sumOfQuantity = groupByProductId.sum() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Logout current GitHub credentials and remove global user.name, user.email | |
echo -e "host=github.com\nprotocol=https\n" | git credential-manager-core erase | |
git config --unset-all --global user.name | |
git config --unset-all --global user.email |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/sbin/softwareupdate --install-rosetta --agree-to-license |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -rf ~/.gnupg/*.lock | |
rm -rf ~/.gnupg/public-keys.d/*.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import math | |
def mod_pow(a, x, N): | |
y = 1 | |
while (x > 0): | |
if ((x & 1) == 1): | |
y = (y * a) % N | |
x = x >> 1 | |
a = (a * a) % N |