Skip to content

Instantly share code, notes, and snippets.

View acidsound's full-sized avatar

LEE JAE HO acidsound

View GitHub Profile
@acidsound
acidsound / multiView.html
Created November 19, 2012 06:58
publishing & subscribing multiple subsets of the same server collection in Meteor
<head>
<title>multiView</title>
</head>
<body>
{{> hello}}
</body>
<template name="hello">
<h3>ViewA</h3>
@acidsound
acidsound / staticHTTP.coffee
Created November 22, 2012 17:53
static HTTP and socket.io example with connect
connect = require('connect')
io = require('socket.io')
server = connect.createServer(
connect.favicon()
, connect.logger()
, connect.static(__dirname + '/public')
)
server.listen(8000)
@acidsound
acidsound / client.coffee
Created November 22, 2012 18:54
file upload in meteor
Meteor.saveFile = (file)->
fileReader = new FileReader()
fileReader.onload = (blob) ->
Meteor.call 'saveFile',
file:file
blob:blob.srcElement.result
fileReader.readAsBinaryString file
return
# event for upload
@acidsound
acidsound / gl - category.csv
Created November 24, 2012 20:08
fixture csv for gl
name code
All
Software C001
Computer Music C002
Recording C003
Microphone C004
Synth & Keyboard C005
Accessories C006
Mixing Console C007
B-Stock Lounge C008
require('http').createServer((q,r)->require('fs').readFile(process.cwd()+q.url,(e,d)->r.end if e? then JSON.stringify(e) else d.toString())).listen 3000 or process.env.PORT
@acidsound
acidsound / sharedStrings.xml
Last active December 12, 2015 03:18
xlsx 중 worksheet xml 의 예. 전체 디렉토리 구조는 http://i48.tinypic.com/6o2bn8.png
<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="173" uniqueCount="116">
<si>
<t>번호</t>
</si>
<si>
<t>시설</t>
</si>
<si>
<t>장소</t>
</si>
@acidsound
acidsound / sortForKorean.mm
Created March 2, 2013 17:57
objective-c에서 한글>영문>숫자 순으로 정렬.
@implementation NSString (Support)
- (NSComparisonResult) sortForIndex:(NSString*)comp {
// 기본 localizedCaseInsensitiveCompare는 숫자, 영문(대소무시), 한글 순 정렬
// 한글 > 영문(대소구분 없음) > 숫자 > $
// 그외 특수문자는 전부 무시한채 인덱싱
// $는 예외
// self 가 @"ㄱ" 보다 작고 (한글이 아니고) , comp 가 @"ㄱ"보다 같거나 클때 - 무조건 크다
// 비교하면 -1 0 1 이 작다, 같다, 크다 순이므로 +1 을 하면 한글일때 YES 아니면 NO 가 된다.
// self 가 한글이고 comp 가 한글이 아닐때 무조건 작다인 조건과
@acidsound
acidsound / TinyGCMServer.go
Last active December 14, 2015 17:19
1. go get github.com/googollee/go-gcm 2. go build TinyGCMServer.go 3. ./TinyGCMServer.go <API_KEY> <Server URL(:port)>
// +build !appengine
package main
/*
* Usage: ./TinyGCMServer <API_KEY> <Server URL(:port)>
* Test: curl -d "<NOTIFICATION MESSAGE>" http://serverURL/sendMessage?target=<REGISTRATION_ID>
*/
import (
"fmt"
gcm "github.com/googollee/go-gcm"
settings = {
jshint: true,
editor: {
"lineNumbers":true,
"lineWrapping":true,
"tabSize":2,
"theme":"eclipse",
"indentUnit":2,
"indentWithTabs": true,
"smartIndent":true,
@acidsound
acidsound / m4aPlayer.as
Created April 2, 2013 17:47
as3 에서 m4a 파일을 로드하는 예제
package {
import flash.display.MovieClip;
import flash.net.NetStream;
import flash.net.NetConnection;
import flash.events.NetStatusEvent;
import flash.events.AsyncErrorEvent;
import flash.events.Event;
import flash.events.MouseEvent;