Skip to content

Instantly share code, notes, and snippets.

View iamssen's full-sized avatar
🏄‍♂️

Seo Yeon, Lee iamssen

🏄‍♂️
  • Seoul, Korea
View GitHub Profile
@iamssen
iamssen / Vector Sort Comapre Functions.as
Last active October 11, 2015 12:57
Vector Sort Compare Functions
/** sort compare function : 무작위로 섞는다 */
function random(a : Number, b : Number) : Number {
return MathUtils.rand(0, 1000000);
trace(a, b);
}
/** sort compare function : 숫자형을 역순정렬 한다 */
function desc_number(a : Number, b : Number) : Number {
return b - a;
}
@iamssen
iamssen / CustomChartElement.as
Created April 12, 2013 05:45
Chart Background, Annotation Drawing
package test {
import avmplus.getQualifiedClassName;
import mx.charts.chartClasses.CartesianChart;
import mx.charts.chartClasses.ChartElement;
import mx.core.mx_internal;
use namespace mx_internal;
public class CustomChartElement extends ChartElement {
@iamssen
iamssen / gist css control.html
Last active December 16, 2015 03:29
gist 를 embed 할 때 만져야 하는 css path 설명
<html>
<head>
<style type="text/css">
html, body, .gist table {
font-size: 12px;
}
</style>
</head>
<body>
가나다라마바사 <br />
@iamssen
iamssen / coffee initialize test.coffee
Last active December 16, 2015 05:09
object types 의 class property 에 초기값을 선언할 경우 static 과 같이 모든 class instance 에서 공유하는 현상이 생긴다. object 형태의 property 가 필요할 경우에는 constructor 에서 초기화 시키는 것이 좋다.
require('source-map-support').install()
class AAA
gl : null
constructor : (gl) ->
if not @gl?
@gl =
a : 1
b : 2
@iamssen
iamssen / screen.md
Last active December 16, 2015 05:38
SSH 접속 종료시 node.js 등이 종료되는 현상을 잡는 screen 기능
  • $ screen -list 스크린 리스트 보기
  • $ screen -r 16546.pts-1.ssenbuntu 스크린 재접속
  • $ screen -d or ctrl + d or ctrl + a, d 스크린 나오기
  • ctrl + a, w 윈도우 리스트 보기
  • ctrl + a, " 윈도우 선택
  • ctrl + a, c 새 윈도우 만들기
  • ctrl + a, a 바로 전 윈도우로 이동
  • ctrl + a, 숫자 해당 윈도우로 이동
  • exit 윈도우 닫기
@iamssen
iamssen / Cakefile
Last active December 16, 2015 05:39
Cakefile 에서 stdout 로그를 지속적으로 출력
task 'run', 'Run Server', ->
build ->
node = exec('node lib/server.js')
node.stdout.on 'data', (data) ->
console.log(data.toString('utf8'))
node.stderr.on 'data', (data) ->
console.log(data.toString('utf8'))
build = (callback) ->
coffee = exec('coffee -m -o lib/ -c src/')
@iamssen
iamssen / App.mxml
Last active December 16, 2015 05:39
AIR 자동 업데이트 설정
private function update_initHandler(event:Event):void {
trace("DashboardApp.update_initHandler()", event);
if (!Capabilities.isDebugger && update.state === AIRUpdateState.AVAILABLE) {
update.update();
} else {
currentState="run";
}
}
<update:AIRUpdate id="update" updateURL="http://xxx.com/air/update.xml" init="update_initHandler(event)"/>
@iamssen
iamssen / Dropbox and Node.md
Last active December 16, 2015 05:49
Markdown Binder on Dropbox + Azure + Ubuntu + Node.js
  • sudo -E node server.js os 의 environments 를 node.js 에서 읽어들이도록 설정
  • process.env.ENV_NAME os 의 environments 읽기
@iamssen
iamssen / Cakefile
Created April 16, 2013 23:22
my common styles and scripts
{exec} = require('bbang')
task 'download', 'Download Files', ->
download()
download = (callback) ->
exec 'curl https://gist.github.com/iamssen/5400496/raw/5e8540a31b2ae05312bc8daee3868d06c71de5f5/markdown.css -o markdown.css', ->
exec 'curl https://...prettify.css -o prettify.css', callback
@iamssen
iamssen / rest.md
Created April 17, 2013 08:07
OAuth2 로 github 로그인 처리 단계별 처리...

Github OAuth 참고

우선 https://github.com/settings/applications 에서 Application 에 등록된 정보들 확인

로그인처리

  1. get https://github.com/login/oauth/authorize?client_id={client_id}&redirect_uri={http://...} 형태로 어플리케이션 등록 정보를 바탕으로 앱 승인 주소로 날려보냄
  2. get http://ssen.name/devlog?code=x1aa07b850cbf6eeba1a 과 같은 형태로 code 를 보내주게 됨
  3. 받은 코드를 사용해서 post https://github.com/login/oauth/access_token 로 정보를 요청
  • header Accept : application/json
  • param code : {받은 코드}