Skip to content

Instantly share code, notes, and snippets.

@TaopaiC
TaopaiC / postMessage.html
Last active October 10, 2015 21:37
test page for postMessage to set modal size
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="test page for postMessage to set modal size">
<meta charset="utf-8">
<meta name="robots" content="noindex">
<title>Test page for postMessage to set modal size</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script>
function evalButton(event) {
@TaopaiC
TaopaiC / cat_1.json
Last active August 29, 2015 14:27
sample json files
{
"id": 1,
"name": "Pow Cat",
"description": "This is a cat"
}
# Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed.
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#
@TaopaiC
TaopaiC / insecure-logstash-forwarder.crt
Last active August 29, 2015 14:03
logstash.conf with lumberjack
-----BEGIN CERTIFICATE-----
MIICGTCCAYICCQD6Ndu9SZ+fwTANBgkqhkiG9w0BAQsFADBRMQswCQYDVQQGEwJU
VzETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0
cyBQdHkgTHRkMQowCAYDVQQDDAEqMB4XDTE0MDcwNzE3MTIzNFoXDTI0MDcwNDE3
MTIzNFowUTELMAkGA1UEBhMCVFcxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNV
BAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEKMAgGA1UEAwwBKjCBnzANBgkq
hkiG9w0BAQEFAAOBjQAwgYkCgYEA21OiWDg5YKkmUTFafYS23N+g0dl7GYz9p/zm
Zq2pDQIcCp9OQLTh91AkXwSJ5l2cWxJCF1fG+EC/P6SNCzwZ1+TaPbk4rEQVIKcS
aQd7kzGGlo0MgleDQjKKRS9ad9kkZRbSp4PWy6HMlZa0HIncdGnrsdpgsNBI/SYf
5DcmrzcCAwEAATANBgkqhkiG9w0BAQsFAAOBgQAlwYjzTGNUrNlJHpYfn2Me0bRK
# Minimal Dockerfile to test docker build steps.
# issue: https://github.com/dotcloud/docker/issues/5135
#
# List base image build steps:
# docker history ubuntu:14.04
#
# Build:
# docker build .
FROM ubuntu:14.04
@TaopaiC
TaopaiC / gist:3597010
Created September 2, 2012 11:12
Fix jasmine-headless-webkit-0.8.4
  • add #include "getopt.h" to ext/jasmine-webkit-specrunner/specrunner.cpp
  • fix coffee script compile error: replace all \033 to \x1B in vendor/assets/coffeescripts/intense.coffee
# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D
rails_env = ENV['RAILS_ENV'] || 'production'
# 16 workers and 1 master
worker_processes (rails_env == 'production' ? 16 : 4)
# Load rails+github.git into the master before forking workers
# for super-fast worker spawn times
preload_app true
function ShakeIt(config) {
this.config = config;
this.scores_page = config["scores_page"];
this.game_page = config["game_page"];
this.goal = config["goal"];
this.db = config["db"];
this.score = 0;
this.old_axis = 0;
this.game_started = false;
<html>
<head>
<title>Float</title>
<style type="text/css">
#bigbox {
background-color: #555;
min-width:120px;
}
#littlebox {
class PostsController < ApplicationController
before_filter :find_forum
before_filter :find_post, :except => [:index, :new, :create]
def index
@posts = @forum.posts
end
def show
end