Skip to content

Instantly share code, notes, and snippets.

View jinto's full-sized avatar

박제권 (Jay Park) jinto

  • Seoul
View GitHub Profile
@jinto
jinto / 0_reuse_code.js
Created November 21, 2013 12:45
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# 현재 가장 잘 동작하는 버전인듯
# postgres는 설치했다고 가정하자.
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
# 환경변수에 LC_COLLATE=C 이거 있는지 확인
@jinto
jinto / gist:5465460
Last active December 16, 2015 16:49
@Grapes([
@Grab(group='postgresql', module='postgresql', version='8.4-701.jdbc4'),
@GrabConfig(systemClassLoader = true)
])
import groovy.sql.Sql
def sql = Sql.newInstance("jdbc:postgresql://localhost/ebsa_dev", "jinto", "", "org.postgresql.Driver")
i = 0;
@jinto
jinto / gist:4662445
Created January 29, 2013 07:22
8줄짜리 그루비 웹서버
import com.sun.net.httpserver.*;
HttpServer server = HttpServer.create(new InetSocketAddress(2222),0)
server.createContext('/', { HttpExchange exchange ->
exchange.sendResponseHeaders(200,0);
exchange.responseBody.write("hello from groovy land.".bytes)
exchange.responseBody.close();
i++;
} as HttpHandler)
server.start();
@jinto
jinto / Gemfile
Created October 24, 2012 01:17
rails 시작
source 'https://rubygems.org'
gem 'rails', '3.2.8'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'devise'
gem 'omniauth'
@jinto
jinto / gist:3140928
Created July 19, 2012 05:19
여기가 H1

여기는 몰라

  • 일단 Markdown 도 지원한다 이거지...
@jinto
jinto / Shell log.sh
Created April 3, 2012 17:53 — forked from acdha/Shell log.sh
Contortions needed to create an AWS RDS database using UTF-8
brew install rds-command-line-tools
rds-create-db-parameter-group mysql-utf-param --db-parameter-group-family mysql5.5 --description "MySQL 5.5 configured for UTF-8" --region us-west-1
rds-modify-db-parameter-group mysql-utf-param \
--parameters="name=character_set_server, value=utf8, method=immediate" \
--parameters="name=character_set_client, value=utf8, method=immediate" \
--parameters="name=character_set_results,value=utf8,method=immediate" \
--parameters="name=collation_server, value=utf8_general_ci, method=immediate" \
@jinto
jinto / app.rb
Created March 29, 2012 12:11
get thumbnail of a website
require 'rubygems'
require 'sinatra'
#require "sinatra/reloader" if development?
require "sinatra/reloader"
require 'RMagick'
require 'watir-webdriver'
require 'base64'
# 웹사이트 썸네일 만들기. 시나트라에서 테스트완료.
#set :server, :thin
@jinto
jinto / gist:2050391
Created March 16, 2012 14:49
functional express handler
express.post('/api/create-post-head', auth.filter.login(), function (req, res, next) {
prepareRoleAndForm(req, function (role, form) {
checkCategoryWritable(res, role, form.categoryId, function (category) {
checkFormThreadAndPost(res, form, function () {
insertThread(form, function (err, thread) {
if (err) return next(err);
insertPost(req, form, thread, function (err, post) {
if (err) return next(err);
res.json(200, {threadId: thread._id, postId: post._id});
});
@jinto
jinto / height.js
Created January 8, 2012 14:46
스마트에디터 높이제어
oEditors.getById["content"].exec("MSG_EDITING_AREA_RESIZE_STARTED", []);
oEditors.getById["content"].exec("RESIZE_EDITING_AREA_BY", [newidth, newheight]);
oEditors.getById["content"].exec("MSG_EDITING_AREA_RESIZE_ENDED", []);