Skip to content

Instantly share code, notes, and snippets.

Avatar

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
View test.sh
curl -X POST \
--header 'Content-Type: application/json' \
-d '{"ph":"0912345678","nick":"","name":"Thar Htet","email":"bla@gmail.com","pwd":"12345678"}' \
http://localhost:3000/sign_up
View feeds.sh
curl --header 'Content-Type: application/json' \
--header 'Snit-Session: <skey>' \
http://localhost:3000/feed/<epoch>
curl --header 'Content-Type: application/json' \
--header 'Snit-Session: <skey>' \
http://localhost:3000/feed/0
View test2.sh
curl --header 'Content-Type: application/json' \
--header 'Snit-Session: SNIT_SESSION_KEY' \
http://<api_url>/feed/mine
View redlink_diagnostic.md
@mmhan
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
<?php
/*************************************
* Class with methods to decode a signed request easily, for App embedded as Tab on a profile page.
*
* @ModifiedBy Mike - @mmhan - mmhan.net
* @author Nathron
* @url http://nathrondevblog.blogspot.com/2010/09/how-to-get-user-id-in-profile-tab.html
*
* @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
mmhan / cw_player.js
Created May 18, 2011
CWPlayer, Comwerks' Silverlight Videoplayer using http://slvideoplayer.codeplex.com/
View cw_player.js
(function($){
$.fn.CwPlayer = function(options){
var settings = {
'thumbs' : 'cwVidThumb',
'width' : 640,
'height' : 360,
'source' : ''
};
function getVideoTemplate(url, options){
@mmhan
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(elem.id!=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
mmhan / demo.html
Created Sep 21, 2011
Video Player embed tag
View demo.html
<html>
<head>
<title>Video Player</title>
</head>
<body>
<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=http://www.sonypictures.com/movies/21/video/trailer/21_trailer_high.asx" />
You can’t perform that action at this time.