Skip to content

Instantly share code, notes, and snippets.

View afrontend's full-sized avatar

Bob Hwang afrontend

View GitHub Profile
@afrontend
afrontend / .synergy.conf
Last active February 6, 2021 05:30
Synergy 컴파일 하기 위한 스크립트 (v1.8.8) 그리고 synergy 설정 파일, https://agvim.wordpress.com/2018/02/24/synergy/
# sample synergy configuration file
#
# comments begin with the # character and continue to the end of
# line. comments may appear anywhere the syntax permits.
section: screens
# three hosts named: moe, larry, and curly
moe:
larry:
curly:
@afrontend
afrontend / app.service.js
Last active February 27, 2018 04:36
dlserver app에서 사용하는 web api 접근을 위한 AngularJS 서비스 코드의 일부
function getLibraryNames(callback) {
$http({
method: 'GET',
url: '/libraryList'
}).then(function successCallback(response) {
if(callback) {
callback(response.data);
}
}, function errorCallback(response) {
$log.log('status: ' + response.status);
@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일")
}
@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;
#!/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 / 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');
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 / 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]}"
@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 / 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