Skip to content

Instantly share code, notes, and snippets.

View omkz's full-sized avatar
🏠
Working from home

Kurnia Muhamad omkz

🏠
Working from home
View GitHub Profile
@omkz
omkz / gist:3987621
Created October 31, 2012 15:20 — forked from pyzen/gist:3987597
Set up Django, nginx and uwsgi

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

  • virtualenv
  • Django
  • nginx
  • uwsgi
@omkz
omkz / Gemfile
Created November 14, 2013 00:22 — forked from levymetal/Gemfile
gem 'will_paginate', '~> 3.0'
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render json: user.as_json(auth_token: user.authentication_token, email: user.email), status: :created
return
else
var xmpp = require('node-xmpp'),
secret = require('./secret'),
util = require('util');
var creds = {
jid: 'bengoering@gmail.com',
password: secret.pw, //string
};
var GChat = function(creds) {
@omkz
omkz / vps_setup.md
Created December 31, 2013 06:19 — forked from sabril/vps_setup.md

Deploy Rails app to digitalocean/amazon EC2 with nginx, unicorn, capistrano & postgres

ubuntu 12.10 x32

ssh to root in terminal with your server ip

ssh root@123.123.123.123

or for ec2 you will need your public key

@omkz
omkz / .gitignore
Created January 19, 2014 19:13 — forked from valryon/.gitignore
# =============== #
# Unity generated #
# =============== #
Temp/
Obj/
UnityGenerated/
Library/
# ===================================== #
# Visual Studio / MonoDevelop generated #
@omkz
omkz / chat.rb
Created March 1, 2014 14:36 — forked from emad-elsaid/chat.rb
require 'sinatra' # gem install sinatra --no-rdoc --no-ri
set :port, 3000
set :environment, :production
html = <<-EOT
<html><head><style>
#text{width:100%; font-size: 15px; padding: 5px; display: block;}
</style></head><body>
<input id="text" placeholder="Write then press Enter."/>
<div id="chat"></div>
require 'tumblr_client'
require 'mechanize'
require 'date'
require 'yaml'
require 'uri'
Tumblr.configure do |config|
config.consumer_key = "consumer_key"
config.consumer_secret = "consumer_secret"
config.oauth_token = "oath_token"
<% [:notice, :error, :alert].each do |level| %>
<% unless flash[level].blank? %>
<div class="alert-message <%= flash_class(level) %>">
<a class="close" href="#">×</a>
<%= content_tag :p, flash[level] %>
</div>
<% end %>
<% end %>
@omkz
omkz / api.js
Created April 29, 2014 22:45 — forked from fwielstra/api.js
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');