Skip to content

Instantly share code, notes, and snippets.

@simkimsia
simkimsia / basic.js
Created Sep 20, 2012
Using turnjs with File API of HTML5
View basic.js
/*
* Basic sample
*/
function addPage(file, pageNumber, book) {
var id, pages = book.turn('pages');
var reader = new FileReader();
reader.onload = (function (theImg) {
@simkimsia
simkimsia / conflicts.md
Last active Jul 11, 2018
text diagram for git conflicts
View conflicts.md
              master
                |
                |
   +-------<----+----->------+
   |            |            |
   |            |            |
   |            |            |
branch1         |         branch2
   |            |            |
View another_expected_config.js
// inspired by datatables.net
// see https://datatables.net/examples/basic_init/filter_only.html for example
$(document).ready(function() {
$('#example').TableUp( {
"paging": true,
"rowsPerPageOptions": [2, 5, 10],
"rowsPerPage": 5,
"checkbox": true,
"search": true
View kafka-commands.md

Commands

How to get started

  1. start docker

  2. run this command in 1 terminal

docker run --rm -it \
           -p 2181:2181 -p 3030:3030 -p 8081:8081 \
           -p 8082:8082 -p 8083:8083 -p 9092:9092 \
@simkimsia
simkimsia / basic.js
Created Sep 20, 2012
Using turnjs without FileAPI but with prepared images
View basic.js
/*
* Basic sample
*/
function addPage(file, pageNumber, book) {
var id, pages = book.turn('pages');
var reader = new FileReader();
reader.onload = (function (theImg) {
@simkimsia
simkimsia / steps.md
Created Apr 5, 2018
how to run postgresql data replication
View steps.md
  1. install postgres (on both servers)

  2. omnipitr (on both servers)

  • download and extract omnipitr archive
  • cd /var/lib/postgresql
  • as postgres, wget https://codeload.github.com/omniti-labs/omnipitr/zip/v1.3.3
  • as ubuntu, sudo apt-get install unzip
  • as postgres, go to ~ and unzip v1.3.3
  • as postgres, mkdir ~/.omnipitr
  • as postgres, run sanity check (see evernote for details)
@simkimsia
simkimsia / TravisBuildInREADME
Created Nov 17, 2013
The Travis Build Status in README using markdown
View TravisBuildInREADME
[![Build Status](https://travis-ci.org/{your_travis_nick}/{PluginName}.png)](https://travis-ci.org/{your_travis_nick}/{PluginName})
@simkimsia
simkimsia / install-jenkins-on-ubuntu-12-10.sh
Last active Dec 7, 2017
Install jenkins on a fresh ubuntu 12.10.
View install-jenkins-on-ubuntu-12-10.sh
#!/bin/bash
###
#
# Copyright (c) 2013 KimSia Sim
#
# Ubuntu 12.10 based install jenkins and other related plugins
# Run this by executing the following from a fresh install of Ubuntu 12.10 server:
#
# bash -c "$(curl -fsSL https://gist.github.com/simkimsia/4473000/raw/5e301a3bd399096e7cbbe3b1a877997a117aa7a3/install-jenkins-on-ubuntu-12-10.sh)"
@simkimsia
simkimsia / README.md
Last active Jun 27, 2017
How to setup Ubuntu 14.04 for Python Django
View README.md

How to setup Ubuntu 14.04 server for Python Django Web App

Assuming you are in root

Make sure the locale is set to UTF-8

locale-gen UTF-8

Create a .bash_profile in the ~/ with the following entries

@simkimsia
simkimsia / download_composer.sh
Last active May 31, 2017
Inspired by http://askubuntu.com/a/165241/10591 this gist shows the bash commands required to have a global installation of composer and also available for all users to access
View download_composer.sh
#!/bin/bash
###
#
#
# Run this by executing the following:
#
# bash -c "$(curl -fsSL https://gist.githubusercontent.com/simkimsia/0c218cadbb3055d53417/raw/download_composer.sh)"
#
# Also, run this as root, unless you enjoy failing.