Skip to content

Instantly share code, notes, and snippets.

View rhee's full-sized avatar

Sang-Hoon RHEE rhee

View GitHub Profile
alias xKS='xmodmap -e "remove Lock = Caps_Lock" -e "keycode 66 = Control_L" -e "add Control = Control_L" -e "keycode 9 = Escape asciitilde"'
alias xKs='xmodmap -e "remove Control = Control_L" -e "keycode 66 = Caps_Lock" -e "add Lock = Caps_Lock" -e "add Control = Control_L" -e "keycode 9 = Escape"'
@rhee
rhee / centos6-post-install
Last active August 29, 2015 14:10
centos6 post-install script
curl -L -O http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
curl -L -O http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/ius-release-1.0-13.ius.centos6.noarch.rpm
curl -L -O http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh *.rpm
yum install -y yum-plugin-replace
@rhee
rhee / index.example.php
Created January 6, 2015 07:18
my *unofficial* php script to replace unknown server-side include scheme used for goosh.org
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>goosh.org - the unofficial google shell.</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<style type="text/css">
html { height: 100%; }
body { background: #fff; font-size: 14px; font-family: monospace; height: 99%; margin:0px; padding: 0px; }
form { padding: 0px; margin: 0px; }
@rhee
rhee / dos-for-loop-example.bat
Last active October 8, 2018 12:58
안드로이드 앱을 통해 생성한 Gist
for /f "delims=*" %l in (test.txt) do for /f "delims=, tokens=1,2" %a in ("%l") do echo rename %b %a_%b
-- http://dossy.org/2011/09/mysql-geo-distance-code-and-samples/
DELIMITER $$
DROP FUNCTION IF EXISTS geodist $$
CREATE FUNCTION geodist (
src_lat DECIMAL(9,6), src_lon DECIMAL(9,6),
dst_lat DECIMAL(9,6), dst_lon DECIMAL(9,6)
) RETURNS DECIMAL(6,2) DETERMINISTIC
BEGIN
#!/bin/sh
dxbin=$( find "$ANDROID_HOME/build-tools" -type f -name dx | tail -1 )
if [ ! -x "$dxbin" ]; then
echo "dx not found"
exit 1;
fi
for input in "$@"; do
count=$( "$dxbin" --dex --output=- "$input" | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"' )
echo $count "$input"
/*
*/
javascript:!function(c,f,e){e=c("SCRIPT");e.src="https://gist.github.com/rhee/81bea288c8516377e8bbffbd7e0e5f1b.js";e.type="text/javascript";f("head")[0].appendChild(e)}(document.createElement,document.getElementByTagName)
/*
*/
// Emacs:
// mode: javascript
// c-basic-offset: 4
// tab-width: 4
// indent-tabs-mode: nil
// End:
// vim: se ft=javascript st=4 ts=8 sts=4
# See: http://stackoverflow.com/a/2649540/496899
# Read in a WAV and find the freq's
import pyaudio
import wave
import numpy as np
chunk = 2048
# exerpt from: http://kidsreturn.org/2014/10/osx-tools/ (Vincent,2014)
xcode-select --install
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew upgrade
brew tap homebrew/dupes