Skip to content

Instantly share code, notes, and snippets.

View hailiang-wang's full-sized avatar
🌴
On vacation

Hai Liang W. hailiang-wang

🌴
On vacation
View GitHub Profile

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@hailiang-wang
hailiang-wang / gist:19a172a35fa59932cf64
Created July 7, 2014 05:40
the quickest way to inherit methods in javascript via prototype
// define a parent
var s = {
print: function(x) {
console.log(x);
}
}
s.print('Hello World');
// now define a heir
var m = {};
@hailiang-wang
hailiang-wang / app.js
Created September 1, 2014 19:06 — forked from shazron/app.js
requirejs(['cordova.js'],
function () {
// start of require
// cordova is now available globally
var exec = cordova.require('cordova/exec');
var app = {
// Application Constructor
/*
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-confirm="Are you sure?">
*/
(function() {
<img src="http://musa-hw-cafe.qiniudn.com/Screen%20Shot%202014-10-16%20at%2011.12.12.png" width="320px" height="100px"/>
宝莲灯是位置感知服务的客户端。
* 位置感知服务是什么?
基于近场通信技术,渲染实时室内地图,在消费场所,为消费者与消费者、消费者与商户提供基于位置服务的社交网络。
* 典型应用场景
@hailiang-wang
hailiang-wang / helloworldcafe-menu
Created November 4, 2014 08:24
hello world cafe menu
var jf = require('jsonfile')
var file = 'config/helloworld-food.json'
function save(){
jf.writeFileSync(file, data)
}
var data = {
"美味套餐":[
@hailiang-wang
hailiang-wang / Ionic-Starter---Sidemenu-and-Tabs.markdown
Created November 19, 2014 02:25
Ionic Starter - Sidemenu and Tabs
@hailiang-wang
hailiang-wang / index.html
Created November 19, 2014 08:42
ion-search directive with Ionic framework
<html ng-app="ionicApp">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>Search directive example</title>
</head>
<body>
@hailiang-wang
hailiang-wang / Pull-To-Refresh:-1.0.0-beta.11.markdown
Created November 19, 2014 08:51
Pull To Refresh: 1.0.0-beta.11
@hailiang-wang
hailiang-wang / Ionic-Profile-Example:-v0.9.25.markdown
Created November 22, 2014 05:18
Ionic Profile Example: v0.9.25