This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To remove a local branch from your machine: | |
git branch -d the_local_branch | |
To remove a remote branch: | |
git push origin :the_remote_branch | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.trim() 去除字符串两端的空格。 | |
$.each() 遍历一个数组或对象。 | |
$.inArray() 返回一个值在数组中的索引位置。如果该值不在数组中,则返回-1。 | |
$.grep() 返回数组中符合某种标准的元素。 | |
$.extend() 将多个对象,合并到第一个对象。 | |
$.makeArray() 将对象转化为数组。 | |
$.type() 判断对象的类别(函数对象、日期对象、数组对象、正则对象等等)。 | |
$.isArray() 判断某个参数是否为数组。 | |
$.isEmptyObject() 判断某个对象是否为空(不含有任何属性)。 | |
$.isFunction() 判断某个参数是否为函数。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// console.log(itemUsedCurrencys); | |
// console.log(itemOriginCurrencys); | |
var itemOriginCurrencys = ['USD', 'HKD', 'CNY', 'EUD']; | |
var itemUsedCurrencys = ['USD', 'HKD']; | |
var i = itemOriginCurrencys.length; | |
while (i--) { | |
var index = itemUsedCurrencys.indexOf( itemOriginCurrencys[i] ) | |
// console.log('check : '+itemOriginCurrencys[i] + " pos: "+ index); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.done-true { | |
text-decoration: line-through; | |
color: grey; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// // | |
// // | |
// CommonListViewController.h | |
// bitmedia | |
// | |
// Created by meng qian on 14-1-22. | |
// Copyright (c) 2014年 thinktube. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instead of using delegation for passing the data, consider using NSNotificationCenter to communicate between your view controllers in this situation. | |
// In your first view controller you will register to listen for a notification: | |
- (void)viewDidLoad | |
{ | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(handleFourthViewSubmit:) | |
name:@"fourthViewSubmit" | |
object:nil]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# xcode-build-bump.sh | |
# @desc Auto-increment the build number every time the project is run. | |
# @usage | |
# 1. Select: your Target in Xcode | |
# 2. Select: Build Phases Tab | |
# 3. Select: Add Build Phase -> Add Run Script | |
# 4. Paste code below in to new "Run Script" section | |
# 5. Drag the "Run Script" below "Link Binaries With Libraries" | |
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cityList = [ | |
{key: "610100", label:"西安", daLabel:"西安市",region:"华南"}, | |
{key: "130100", label:"石家庄", daLabel:"石家庄市",region:"华南"}, | |
{key: "350200", label:"厦门", daLabel:"厦门市",region:"华南"}, | |
{key: "410100", label:"郑州", daLabel:"郑州市",region:"华南"}, | |
{key: "440600", label:"佛山", daLabel:"佛山市",region:"华南"}, | |
{key: "350100", label:"福州", daLabel:"福州市",region:"华南"}, | |
{key: "440100", label:"广州", daLabel:"广州市",region:"华南"}, | |
{key: "230100", label:"哈尔滨", daLabel:"哈尔滨市",region:"华南"}, | |
{key: "110100", label:"北京", daLabel:"北京市",region:"华南"}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as fs from 'fs'; | |
import * as path from 'path'; | |
// app 目录 | |
const appFolder = path.resolve(__dirname, '../app'); | |
console.log(appFolder); | |
// sync version | |
function walkSync(currentDirPath, callback) { | |
fs.readdirSync(currentDirPath).forEach(function (name, index) { |