Skip to content

Instantly share code, notes, and snippets.


Mike Myat Min Han mmhan

View GitHub Profile
View gist:8930152
The parameter weekday is True if it is a weekday, and the parameter vacation is True if we are on vacation. We sleep in if it is not a weekday or we're on vacation. Return True if we sleep in.
sleep_in(False, False) → True
sleep_in(True, False) → False
sleep_in(False, True) → True
curl -X POST \
--header 'Content-Type: application/json' \
-d '{"ph":"0912345678","nick":"","name":"Thar Htet","email":"","pwd":"12345678"}' \
curl --header 'Content-Type: application/json' \
--header 'Snit-Session: <skey>' \
curl --header 'Content-Type: application/json' \
--header 'Snit-Session: <skey>' \
curl --header 'Content-Type: application/json' \
--header 'Snit-Session: SNIT_SESSION_KEY' \
mmhan / fb_decode.php
Created Apr 25, 2011
A useful class to retrieve SignedRequest from a Facebook App embedded as tab in a Facebook Page. Particularly useful in finding out visiting user's ID and whether the user like the page or not.
View fb_decode.php
* Class with methods to decode a signed request easily, for App embedded as Tab on a profile page.
* @ModifiedBy Mike - @mmhan -
* @author Nathron
* @url
* @usage:
* //In facebook tab page.
View FBReady.js
function FBReady( func ) {
// If facebook is already loaded,
// just call the function
if ( FBReady.done ) return func();
// If the stack already exists,
// push the function onto it,
// otherwise, initialize a stack
// of functions
mmhan / cw_player.js
Created May 18, 2011
CWPlayer, Comwerks' Silverlight Videoplayer using
View cw_player.js
$.fn.CwPlayer = function(options){
var settings = {
'thumbs' : 'cwVidThumb',
'width' : 640,
'height' : 360,
'source' : ''
function getVideoTemplate(url, options){
mmhan / jquery-1.2.4a.js
Created Sep 21, 2011
jquery 1.2.4a and jquery-ui-all-1.5b2 (packed) with detection for better version before loading
View jquery-1.2.4a.js
(!window.jQuery || window.jQuery().jquery < '1.2.4a') && /** detect if a better jquery is there before loading. If better jquery is there stop loading to avoid conflicts **/
(function(){if(window.jQuery){var _jQuery=window.jQuery;}var jQuery=window.jQuery=function(selector,context){return new jQuery.prototype.init(selector,context);};if(window.$){var _$=window.$;}window.$=jQuery;var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;var isSimple=/^.[^:#\[\.]*$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}else{if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1]){selector=jQuery.clean([match[1]],context);}else{var elem=document.getElementById(match[3]);if(elem){if(!=match[3]){return jQuery().find(selector);}else{this[0]=elem;this.length=1;return this;}}else{selector=[];}}}else{return new jQuery(context).find(selector);}}else{if(jQuery.isFunction(
mmhan / demo.html
Created Sep 21, 2011
Video Player embed tag
View demo.html
<title>Video Player</title>
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="640" height="480">
<param name="source" value="VideoPlayer.xap"/>
<param name="background" value="white" />
<param name="initParams" value="m=" />
You can’t perform that action at this time.