Skip to content

Instantly share code, notes, and snippets.

View seia-soto's full-sized avatar
💭
Working from home

HoJeong Go seia-soto

💭
Working from home
View GitHub Profile
@seia-soto
seia-soto / deleteCache.js
Created June 3, 2018 19:24
Deleting cache of required file in NodeJS
delete require.cache[require.resolve('./*')]
@seia-soto
seia-soto / String.proto.bind.js
Last active July 16, 2020 08:20
Simple binding function in JavaScript.
String.prototype.bind = function (parameters) {
let text = this
const keys = text.match(/\{(.*?)\}/g)
if (!keys) return this
for (let i = 0; i < keys.length; i++) {
const keyname = keys[i].replace('{', '').replace('}', '')
text = text.replace(keys[i], parameters[keyname] || '')

Keybase proof

I hereby claim:

  • I am seia-soto on github.
  • I am seia (https://keybase.io/seia) on keybase.
  • I have a public key ASBSNW3VrYjlXMupZf35raLjbV87lWJqUum-myYZUsBAGgo

To claim this, I am signing this object:

@seia-soto
seia-soto / arm64e-linux.sh
Created July 5, 2020 11:21
Installs sbinger's arm64e toolchain to allow arm64e compilation on Linux
curl -LO https://github.com/sbingner/llvm-project/releases/download/v10.0.0-1/linux-ios-arm64e-clang-toolchain.tar.lzma
TMP=$(mktemp -d)
tar --lzma -xvf linux-ios-arm64e-clang-toolchain.tar.lzma -C $TMP
pushd $TMP/ios-arm64e-clang-toolchain/bin
find * ! -name clang-10 -and ! -name ldid -and ! -name ld64 -exec mv {} arm64-apple-darwin14-{} \;
find * -xtype l -exec sh -c "readlink {} | xargs -I{LINK} ln -f -s arm64-apple-darwin14-{LINK} {}" \;
popd
mkdir -p $THEOS/toolchain/linux/iphone
mv $TMP/ios-arm64e-clang-toolchain/* $THEOS/toolchain/linux/iphone/
rm -rf $TMP linux-ios-arm64e-clang-toolchain.tar.lzma
@seia-soto
seia-soto / update.sh
Created July 5, 2020 12:37
Create symlinks on toolchain binaries (theos/theos#528)
find . -name 'arm*' -exec bash -c ' ln -s $0 ${0/arm64\-apple\-darwin14\-}' {} \;
@seia-soto
seia-soto / alpinelinux-mirror.sh
Last active January 28, 2021 01:16
mirror.seia.io
#!/usr/bin/env sh
echo -e "[$(date)] - <alpinelinux> sync is about to start" >> /_seia/projects/mirror/log
# make sure we never run 2 rsync at the same time
lockfile="/tmp/alpine-mirror.lock"
if [ -z "$flock" ] ; then
exec env flock=1 flock -n $lockfile "$0" "$@"
echo -e "[$(date)] - <alpinelinux> stopped the sync because there is lockfile" >> /_seia/projects/mirror/log
fi
@seia-soto
seia-soto / netclass-v8-client-manager.cmd
Last active July 7, 2021 11:05
NetClass v8 client-side manager
@echo off
goto init
:init
cls
echo NetClass v8 Client manager
echo.
@seia-soto
seia-soto / main_1.c
Last active April 7, 2021 10:48
청명고등학교 시스템 프로그래밍 4월 7일 미션
#include <stdio.h>
int main() {
char gender;
float tall;
float weight;
printf("성별을 입력하세요: [f/m] ");
scanf("%c", &gender);
@seia-soto
seia-soto / dnstest.sh
Created June 14, 2021 09:17
Zsh script to test if domain blocked
#!/bin/zsh
domain=
function test_dns() {
echo ""
echo "Testing on $1"
result=$(dig @$1 $domain)