Skip to content

Instantly share code, notes, and snippets.

View netj's full-sized avatar

Jaeho Shin netj

View GitHub Profile
@netj
netj / a.txt
Created September 1, 2010 06:53
Genetic Algorithm for Number Bi-partitioning
100000
6488
13757
16483
29204
31021
70
1887
3704
5522
@netj
netj / netj-icon.js
Created October 9, 2010 15:13
my logo icon drawn with Javascript on an HTML5 canvas
// netj's icon with HTML5 canvas
function drawIconOnCanvas(w, opacity, canvas, a) {
if (canvas.getContext) {
var c = canvas.getContext("2d");
// name some constants
canvas.width = canvas.height = w;
c.clearRect(0, 0, w, w);
var o = w/12;
var l = (w-3*o)/2;
@netj
netj / SetTextEncodingToUTF8.scpt
Created March 26, 2011 03:43
AppleScript that sets text encoding (xattr) of currently selected files in Finder (to UTF-8)
#!/usr/bin/osascript
# AppleScript that sets text encoding (xattr) of currently selected files in Finder (to UTF-8)
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2011-03-25
# See-Also: http://vim.1045645.n5.nabble.com/MacVim-file-encoding-and-Quicklook-td1216113.html
# See-Also: http://xahlee.org/comp/OS_X_extended_attributes_xattr.html
tell application "Finder"
set names to ""
repeat with f in (selection as alias list)
@netj
netj / gist:912261
Created April 10, 2011 11:17
한국 토렌트 사이트의 자바스크립트 다운로드 링크 변환 북마크릿
javascript:var%20s=document.createElement("script");s.src="http://code.jquery.com/jquery-1.5.2.js";document.body.appendChild(s);s.onload=function(){$('a[href^="javascript:file_download("]').each(function(){this.href=eval("var%20file_download=function(a,b){return%20a/*+'#'+b*/;};"+decodeURI(this.href.substring("javascript:".length)));});/*add%20more%20code%20here*/};
@netj
netj / fix-disabled-Mail.app-bundles.command
Created April 20, 2011 04:41
A script for fixing disabled Mail.app bundles due to SupportedPluginCompatibilityUUIDs
#!/usr/bin/env bash
# A script for fixing disabled Mail.app bundles due to SupportedPluginCompatibilityUUIDs
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2011-03-24
# See-Also: http://stib.posterous.com/how-to-fix-unsupported-plugins-after-upgradin
set -eu
newMailUUID=$(defaults read /Applications/Mail.app/Contents/Info PluginCompatibilityUUID)
newMsgUUID=$(defaults read /System/Library/Frameworks/Message.framework/Resources/Info PluginCompatibilityUUID)
@netj
netj / .gitignore
Created October 5, 2011 21:40
iOS Font Modifier -- 한글 글꼴 교체된 iOS ipsw 제작 도구
.DS_Store
.*.sw?
/*,*_*_*.dmg
/Hamchorom-LVT.zip*
/HCRDotum.bundle/files/*
@netj
netj / Custom.css
Created March 13, 2012 05:45
맥 웹브라우저에서 AppleGothic 그만 보이게 하는 사용자 스타일 시트
/*
* 정확히 AppleGothic만 다른 글꼴로 바꾸는 사용자 스타일 시트
*
* 애플고딕을 쓰도록 명시적으로 지정한 사이트에서도 원하는 글꼴로 바꿀 수 있게 해주는 방법이며,
* 영문 글꼴이나 다른 한글 글꼴까지 몽땅 하나로 통일해서 써야 했던 font-family를 강제로 지정하는 방식과는 달리
* 정확히 애플고딕만 다른 글꼴로 바꿔서 사용하는 매우 깔끔한 방법입니다. :)
*
* 사용 방법:
* Safari는 아무 곳에나 저장해두고 환경설정 > 고급 > 스타일 시트에서 파일 선택
* Google Chrome은 ~/Library/Application Support/Google/Chrome/Default/User StyleSheets/Custom.css
@netj
netj / moveAndResize.applescript
Created June 10, 2012 05:08
A piece of AppleScript for changing the size and position of windows
-- moveAndResize -- a piece of AppleScript for changing the size and position of windows
-- Author: Jaeho Shin <netj@sparcs.org>
-- Created: 2012-06-09
(*
Running the following line will move and resize all windows of that application:
tell application "Finder" to my moveAndResize(x,y, windows, w,h)
For x,y,w,h, you can give:
$ ant package
[...]
[ivy:resolve] downloading http://repo1.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar ...
[ivy:resolve] .. (59kB)
[ivy:resolve] .. (0kB)
[ivy:resolve] [SUCCESSFUL ] commons-logging#commons-logging;1.1.1!commons-logging.jar (23ms)
[ivy:resolve]
[ivy:resolve] :: problems summary ::
[ivy:resolve] :::: WARNINGS
[ivy:resolve] [FAILED ] org.apache.hadoop#hadoop-test;0.20.2!hadoop-test.jar: invalid sha1: expected=0547f30bb192ac86ec30b024cc1c44f5ca7c5029 computed=de3813424008d1193254742e341df193742404a0 (124ms)
@netj
netj / bookmarklet.js
Created July 17, 2012 09:27
Read RFC in HTML — Open an HTML version of this RFC document
/* Created with YouScript Bookmarklet Editor
* http://netj.github.com/youscript
*/
if (m=location.href.match(/http:\/\/((.*\.)?ietf\.org\/(rfc|html)|(.*\.)?faqs\.org\/rfcs)\/(rfc[0-9]*)/i)) {
location="http://tools.ietf.org/html/"+m[m.length-1];
} else {
alert("Unrecognized RFC URL: "+location.href);
}