Skip to content

Instantly share code, notes, and snippets.

View afrontend's full-sized avatar

Bob Hwang afrontend

View GitHub Profile
@afrontend
afrontend / onlyNumberWithoutHangul.html
Created October 30, 2020 15:45
<INPUT> 에서 숫자만 입력 받는 방법
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<style type="text/css">
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
text-align: center;
margin-top: 60px;
item[0].type === "screen"
@afrontend
afrontend / staticgen.sh
Last active November 18, 2019 04:55
https://www.staticgen.com/ 의 목록 중에 가장 많이 언급된 단어 찾기
curl -s https://www.staticgen.com/ \
| hgrep -t "p[class*=Card__]" \
| sed -e 's/\s\+/\n/g' \
| sed -e 's/\.//g' \
| sed -e 's/,//g' \
| tr [:upper:] [:lower:] \
| sort \
| uniq -c \
| sort -r \
| head -10
@afrontend
afrontend / index.html
Created August 13, 2019 04:25
small game
<!dohctype html>
<html>
<head lang='en'>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width'>
<title>This is a smallgame</title>
<style>
body {
font-family: 'Helvetica Neue', Arial, sans-serif;
@afrontend
afrontend / getIcon.sh
Created May 6, 2019 05:00
안드로이드 앱에서 아이콘 파일 꺼내기
#!/usr/bin/env bash
command -v jar >/dev/null 2>&1 || { echo >&2 "I require jar program but it's not on the path. Aborting."; exit 1; }
command -v aapt >/dev/null 2>&1 || { echo >&2 "I require aapt program but it's not on the path. Aborting."; exit 1; }
ICON_FILE="$(aapt d --values badging "$1" | grep "application: label" | cut -f 3 -d "=" | cut -f 2 -d "'")"
jar xvf "$1" "${ICON_FILE}" > /dev/null
cp "${ICON_FILE}" .
rm -r "${ICON_FILE}"
IFS='/' read -r -a array <<< "${ICON_FILE}"
echo "${array[-1]}"
#!/usr/bin/env node
const cli = require('cli');
let line_number = 0, re;
cli.withInput(function (line, newline, eof) {
line_number = line_number + 1;
re = new RegExp(process.argv[2]);
if (!eof) {
if(line.match(re)) {
this.output(line.replace(/\)\s*;\s*$/, ', "'+line_number+'");'));
@afrontend
afrontend / gist:c2cff367f93efb0a257d2e94b8dd5101
Last active July 20, 2018 12:14
Install Vim 8 with Python, Python 3, Ruby and Lua support on Ubuntu 18.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev python3.6-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
sudo apt-get install checkinstall
sudo rm -rf /usr/local/share/vim /usr/bin/vim
cd ~
#!/usr/bin/env node
const cli = require('cli'),
moment = require('moment'),
config = require('./config');
function getAndroidTimeStr(str) {
const timeRe = /^\d\d-\d\d \d\d:\d\d:\d\d\.\d\d\d/;
let resultStr = timeRe.exec(str);
return resultStr === null ? "" : resultStr[0];
}
@afrontend
afrontend / mkdirWithDateName.desktop
Last active May 3, 2018 12:17
nautilus-actions 설정 파일과 오늘 날짜로 디렉토리 만들어주는 쉘 스크립트, https://agvim.wordpress.com/2018/04/20/nautilus-context-menu/
[Desktop Entry]
Type=Action
Name[ko]=날짜 폴더
Tooltip[ko]=오늘 날짜 이름으로 폴더를 만든다
Icon[ko]=add
TargetContext=false
TargetLocation=true
ToolbarLabel[ko]=날짜 디렉토리
Profiles=profile-zero;
@afrontend
afrontend / hits.sh
Created March 10, 2018 01:53
가입형 워드프레스 히트 카운트 세는 명령어, https://afrontend.github.io/posts/blog-hit-count/
function hits() {
echo $(curl -s https://agvim.wordpress.com/ | hgrep -t '#blog-stats-18 > ul > li') $(date +"%m월%d일")
}