Skip to content

Instantly share code, notes, and snippets.

View jinto's full-sized avatar

박제권 (Jay Park) jinto

  • Seoul
View GitHub Profile
@jinto
jinto / etc_iptable.up.rules
Created August 9, 2014 14:28
우분투 12.04 생성하고, rails + postgresql + postgis 설정. 어쨌든 최신버전.
*filter
# 이렇게 다 열려있는 iptable이 무슨 소용이 있으리오만.
# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT
# Accepts all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
@jinto
jinto / httpd.conf
Last active August 29, 2015 14:17 — forked from jmorton/Dockerfile
#요기 /etc/httpd/conf/httpd.conf
LoadModule wsgi_module /usr/lib64/httpd/modules/mod_wsgi-py34.cpython-34m.so
WSGIPythonPath /opt/projectname:/opt/venv/lib/python3.4/site-packages
<VirtualHost *:80>
ServerName www.yourserver.com
DocumentRoot /opt/projectname
@jinto
jinto / count_dates_from_birth.m
Created December 30, 2011 17:28
days and hours from birth date
#import <Foundation/Foundation.h>
int main(int argc, const char *argv[])
{
NSString *birthd = @"1971-8-24 09:00:00 +0900";
NSDate *from = [[NSDate alloc] initWithString:birthd];
NSTimeInterval diff = [from timeIntervalSinceNow];
int days = diff / 60 / 60 / 24;
int hours = ((int)diff/60/60) % 24;
@jinto
jinto / noti.m
Created January 3, 2012 11:55
자자자... 노티 노티
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSLog(@"start ---- jinto");
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.viewController = [[_7P3USZ44YViewController alloc] initWithNibName:@"_7P3USZ44YViewController" bundle:nil];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
@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", []);
@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 / 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 / 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 / gist:3140928
Created July 19, 2012 05:19
여기가 H1

여기는 몰라

  • 일단 Markdown 도 지원한다 이거지...
@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'