Skip to content

Instantly share code, notes, and snippets.

View munky69rock's full-sized avatar
:octocat:
Colla(コラ) というサービスを開発してます

Masayuki Uehara munky69rock

:octocat:
Colla(コラ) というサービスを開発してます
View GitHub Profile
@munky69rock
munky69rock / jquery.cache.js
Created May 13, 2012 00:32
jQuery selector cache
// ----
var $$$ = (function(){
var pool = {};
function $$$ (key) {
if (!pool[key]) {
pool[key] = $(key);
}
return pool[key];
}
$$$.clear = function () {
@munky69rock
munky69rock / gist:3411645
Created August 21, 2012 04:44
check android browser log (windows command prompt)
adb.exe logcat -d | findstr browser
@munky69rock
munky69rock / crontab
Created August 21, 2012 08:46
crontab settings
# min / hour / day / month / week
* * * * * exec command
@munky69rock
munky69rock / do-in-bg.sh
Created September 19, 2012 02:39
command to start a background process
#!/bin/sh
nohup $* > nohup.out 2> nohup.err < /dev/null &
@munky69rock
munky69rock / install_vim.sh
Last active December 27, 2016 10:52
install vim
$ sudo apt-get install luajit liblua5.1-0-dev libluajit-5.1-2 libluajit-5.1-dev libperl-dev libpython2.7-dev libpython3-dev ruby-dev
$ ./configure \
--enable-multibyte \
--enable-xim \
--enable-fontset \
--with-features=huge \
--enable-perlinterp \
--enable-pythoninterp \
--enable-python3interp \
--enable-rubyinterp \
@munky69rock
munky69rock / set_cookie.js
Created October 3, 2012 04:12
set cookie with javascript
@munky69rock
munky69rock / duplicate_table.sql
Created November 7, 2012 11:15
duplicate table
create table [duplicate_table_name] like [table_name];
insert into [duplicate_table_name] select * from [table_name];
@munky69rock
munky69rock / vim-pager.sh
Created December 19, 2012 04:41
vim pager
#!/bin/sh -u
set -e
# origin: http://www.songmu.jp/riji/archives/2012/05/post_379.html
# check: http://d.hatena.ne.jp/masudaK/20120223/1330006586
if [[ -p /dev/stdin ]];then
tr -d "\r" | vim -R -
else
@munky69rock
munky69rock / check-url-scheme.js
Created January 18, 2013 07:02
iPhone Safari: check if URL scheme is supported in javascript
// cf: http://stackoverflow.com/questions/627916/iphone-safari-check-if-url-scheme-is-supported-in-javascript
function checkUrlScheme(app_url_scheme, app_install_url, app_name) {
document.location = app_url_scheme;
setTimeout(function() {
if(confirm('You do not seem to have '+app_name+' installed, do you want to go download it now?')){
document.location = app_install_url;
}
}, 300);
}
@munky69rock
munky69rock / fix_ubuntu_utf8_locale.sh
Created January 28, 2013 03:19
[ubuntu][utf-8]localeエラーが発生した場合の修正方法
# [bash: warning: setlocale: LC_ALL: cannot change locale]
sudo locale-gen ja_JP
sudo update-locale LANG=ja_JP.UTF-8