Skip to content

Instantly share code, notes, and snippets.

View sjoonk's full-sized avatar

Sukjoon Kim sjoonk

View GitHub Profile
@sjoonk
sjoonk / passenger_memory_stats
Created June 18, 2012 13:16
Munin Phusion Passenger Plugins
#!/usr/bin/env ruby
# put in /etc/munin/plugins and restart munin-node
# by Dan Manges, http://www.dcmanges.com/blog/rails-application-visualization-with-munin
# NOTE: you might need to add munin to allow passwordless sudo for passenger-memory-stats
def output_config
puts <<-END
graph_category App
graph_title Passenger memory stats
graph_vlabel count
@sjoonk
sjoonk / mongo_cache.rb
Created June 14, 2012 13:45
MongoCache: Simple key/value cache store based on MongoDB/Mongoid
# encoding: UTF-8
# MongoCache
# Using MongoDB as a simple cache store
# by sjoonk@gmail.com 2012
require 'mongoid'
class MongoCache
include Mongoid::Document
@sjoonk
sjoonk / invite_friends.html
Created May 22, 2012 15:00
CookinFB App Template Invite Friends
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>친구 초대하기</title>
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="../stylesheets/facebook.css" type="text/css">
<link rel="stylesheet" href="../stylesheets/application.css" type="text/css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js" type="text/javascript"></script>
<style type="text/css" media="screen">
@sjoonk
sjoonk / simple-event-form.html
Created May 21, 2012 08:27
CookinFB App Template Simple Event Form
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>입력폼이 있는 간단한 이벤트</title>
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="../stylesheets/facebook.css" type="text/css">
<link rel="stylesheet" href="../stylesheets/application.css" type="text/css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js" type="text/javascript"></script>
<style type="text/css" media="screen">
@sjoonk
sjoonk / blog.html
Created May 21, 2012 03:43
Facebook App Template: Blog RSS Feed
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Blog Demo</title>
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="../stylesheets/facebook.css" type="text/css">
<link rel="stylesheet" href="../stylesheets/application.css" type="text/css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js" type="text/javascript"></script>
<body class="container timeline">
@sjoonk
sjoonk / gist:1991638
Created March 7, 2012 07:33
Facebook page app html sample
<!doctype html>
<html xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<meta charset="utf-8">
<title>My Twitter Timeline</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/jquery.jtweetsanywhere-1.3.1.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="js/jquery-1.6.2.min.js" type="text/javascript"></script>
<script src="js/jquery.jtweetsanywhere-1.3.1.min.js" type="text/javascript"></script>
@sjoonk
sjoonk / self_signed_cert.rb
Created January 19, 2012 14:50 — forked from nickyp/self_signed_cert.rb
create a self-signed certificate using ruby-openssl
We couldn’t find that file to show.
@sjoonk
sjoonk / gist:1564068
Created January 5, 2012 06:56
Facebook OpenGraph Tag Sample
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<title>The Rock (1996)</title>
<meta property="og:title" content="The Rock"/>
<meta property="og:type" content="movie"/>
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/"/>
<meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>
<meta property="og:site_name" content="IMDb"/>
<meta property="fb:admins" content="USER_ID"/>
<meta property="og:description"
@sjoonk
sjoonk / gist:1470762
Created December 13, 2011 05:41
Facebook Add Page Tab
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:og="http://ogp.me/ns#"
xmlns:fb="http://www.facebook.com/2008/fbml">
<body>
<a href="#" onclick=window.open("http://www.facebook.com/dialog/pagetab?
app_id=YOUR_APP_ID&next=YOUR_URL","PageTab","width=500,height=200");>
Dialog</a>
</body>
</html>
@sjoonk
sjoonk / tr_server.erl
Created November 30, 2011 06:55
a erlang/otp gen_server module
%%%-------------------------------------------------------------------
%%% @author Martin & Eric <erlware-dev@googlegroups.com>
%%% [http://www.erlware.org]
%%% @copyright 2008-2010 Erlware
%%% @doc RPC over TCP server. This module defines a server process that
%%% listens for incoming TCP connections and allows the user to
%%% execute RPC commands via that TCP stream.
%%% @end
%%%-------------------------------------------------------------------