Skip to content

Instantly share code, notes, and snippets.

@michaelhenry
michaelhenry / num-word-coverter.sql
Last active December 16, 2015 13:19
I wrote this function for financial system project last 4 years ago(2009) and this is my first mssql function that i wrote. This code will convert the numerical form of currency value into word format like what you can see in bank statement account, bank check and other kinds of reciept.
-- Author : Michael Henry Pantaleon
-- Description : Money To Word Converter MSSQL Function
CREATE Function [dbo].[fnOnes]
(
@iOnes CHAR(1)
)
RETURNS VARCHAR(10)
AS BEGIN
Declare @sOutput VARCHAR(10)
@michaelhenry
michaelhenry / paginator.sql
Created May 20, 2013 16:22
Just a mssql code that I wrote from my past :) It will create query paginator :)
DECLARE @PageIndex AS INT;
DECLARE @PageSize AS INT;
DECLARE @PagerSize INT;
SET @PagerSize = 10;
SET @PageIndex = 1222;
SET @PageSize = 10;
DECLARE @AllRow INT;
DECLARE @MaxPageIndex INT;
@michaelhenry
michaelhenry / celerybeat
Last active December 17, 2015 18:19
Celery deployment script
#!/bin/bash
# =========================================================
# celerybeat - Starts the Celery periodic task scheduler.
# =========================================================
#
# :Usage: /etc/init.d/celerybeat {start|stop|force-reload|restart|try-restart|status}
# :Configuration file: /etc/default/celerybeat or /etc/default/celeryd
#
# See http://docs.celeryproject.org/en/latest/tutorials/daemonizing.html#generic-init-scripts
@michaelhenry
michaelhenry / default
Created May 28, 2013 15:33
NGINX Location Config /etc/nginx/sites-enabled/default
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_connect_timeout 10;
proxy_read_timeout 10;
proxy_pass http://127.0.0.1:8000;
}
@michaelhenry
michaelhenry / menu
Last active December 19, 2015 16:28
news magazine menu listing
[{
"text":"Category",
"value":"category",
"list":
[
{
"text":"Latest",
"value":"latest"
},
{
@michaelhenry
michaelhenry / 0_reuse_code.js
Created October 25, 2013 03:31
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@michaelhenry
michaelhenry / ez_setup.py
Created October 28, 2013 05:09
Bootstrap setuptools installation for python
#!python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools, set a download

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@michaelhenry
michaelhenry / s3cmd.sh
Last active August 29, 2015 14:17 — forked from cheannecruz/s3cmd.sh
// How to add Header on existing bucket
s3cmd modify --recursive --add-header=Cache-Control:max-age=86400 s3://BUCKET/FOLDER
@michaelhenry
michaelhenry / xppframework.podspec.json
Created November 5, 2015 04:58
xmppframework.podspec.json
{
"name": "XMPPFramework",
"version": "3.7.2",
"platforms": {
"ios": "5.0",
"osx": "10.7"
},
"license": {
"type": "BSD",
"file": "copying.txt"