Skip to content

Instantly share code, notes, and snippets.

View wei-lee's full-sized avatar

Wei Li wei-lee

  • Intercom
  • Dublin, Ireland
View GitHub Profile
@wei-lee
wei-lee / gist:1298299
Created October 19, 2011 13:38 — forked from feedhenry-gists/gist:1015222
Orientation Call
$fh.ori( {act:'listen'},
function(res){
alert( 'current roation=' + res);
},
function(code,errorprops,params) {...} );
$fh.ori({act:'set', value:'landscape'}, function(res){
alert('orientation changed to ' + res.orientation);
}, function(code, errorprops, params){});
@wei-lee
wei-lee / gist:1336195
Created November 3, 2011 10:14 — forked from feedhenry-gists/gist:1015279
Web View Call
var url = http://www.example.com;
$fh.webview(
{'url':url, 'title':"hello"},
function(result){
if(result === "opened"){
//webview window is now open
}
if(result === "closed"){
//webview window is now closed
}
@wei-lee
wei-lee / downloadfile.js
Created November 16, 2011 10:52
download file using $fh.file
var fileSrc = "http://example.com/test.pdf";
var parts = fileSrc.split("/");
var destFile = parts[parts.length - 1];
var progressListener = function(progress){
//progress value that is passed here is a float number between 0 and 1
//convert it to percentage
$('#download_progress').html('<p> current progress: ' + progress*100 + '%' + '</p>');
}
$fh.file(
{act:'download', src: fileSrc, dest: destFile, progressListener:progressListener},
@wei-lee
wei-lee / non-touch.js
Created December 1, 2011 14:18
Sencha touch for BB6 non-touch
//In Sencha-debug.js, around line 18131, inside Ext.gesture.Manager, change it to this:
//if (!Ext.supports.Touch) {
if (!Ext.supports.Touch || Ext.is.Blackberry) {
Ext.apply(this.eventNames, {
start: 'mousedown',
move: 'mousemove',
end: 'mouseup'
});
}
@wei-lee
wei-lee / nonTouchCompatibleScrollPanel.js
Created December 1, 2011 15:06
Sench non-touch compatible scroll panel
Ext.NonTouchCompatibleScrollPanel = Ext.extend(Ext.Panel, {
scroll: "both",
currentX: 0,
currentY: 0,
listeners: {
render: function(pnl) {
console.log(arguments);
var scrollbar_v = {
cls: 'scrollbar-indicator-container-vertical'
};
@wei-lee
wei-lee / scrollbar.css
Created December 1, 2011 15:32
Css for scroll bars
.scrollbar-indicator-container-vertical {
position: absolute;
top:0px;
background-color: red;
width: 10px;
right: 0px;
}
.scrollbar-indicator-container-horizontal {
position: absolute;
@wei-lee
wei-lee / scrollbars.js
Created December 1, 2011 15:43
iScroll scroll bars
var myScroll;
function loaded() {
//assign a class name for the scroll bars
myScroll = new iScroll('wrapper', { scrollbarClass: 'myScrollbar' });
doBind();
}
function doBind(){
$('.myScrollbarV').unbind().bind('click', function(e){
var offsetY = e.offsetY;
@wei-lee
wei-lee / iscroll_scrollbar.css
Created December 1, 2011 15:44
iScroll scrollbar css
/**
*
* Vertical Scrollbar
*
*/
.myScrollbarV {
position:absolute;
z-index:100;
width:7px;
bottom:7px;
Ext.gesture.Manager = new Ext.AbstractManager({
//first, add more events
eventNames: {
'touchstart': 'start',
'touchmove': 'move',
'touchend': 'end',
'mousedown': 'mousestart',
'mouseup': 'mouseend'
},
defaultPreventedMouseEvents: [],

Backend Architectures

ARCHITECTURES

ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats