Skip to content

Instantly share code, notes, and snippets.

View hoyajigi's full-sized avatar

Hyunseok Cho hoyajigi

  • Lablup Inc.
  • Earth
View GitHub Profile
"
"Hoyajigi Vim setting
"2009-02-09
set autoindent
set cindent
set smartindent
set textwidth=76
set wrap
@hoyajigi
hoyajigi / Aircrack Commands
Created February 19, 2017 01:36 — forked from victorreyesh/Aircrack Commands
Cracking WPA2 / WEP Wifi / Aircrack 10 seconds guide. For Mac OSX
//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]
# 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 -------------------------------------------------------------------
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
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()
@hoyajigi
hoyajigi / git-logout
Created April 19, 2022 02:16
Logout current GitHub credentials
#!/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
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
rm -rf ~/.gnupg/*.lock
rm -rf ~/.gnupg/public-keys.d/*.lock
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