Skip to content

Instantly share code, notes, and snippets.

View tangzhen's full-sized avatar
🎯
Focusing

Zhen Tang tangzhen

🎯
Focusing
  • Chengdu, Sichuan, China
View GitHub Profile
@tangzhen
tangzhen / better-nodejs-require-paths.md
Created January 10, 2016 04:12 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@tangzhen
tangzhen / image.resize.in.github.flavored.markdown.md
Created February 28, 2016 10:59 — forked from uupaa/image.resize.in.github.flavored.markdown.md
image resize in github flavored markdown.

Image source

https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

Try resize it!

  • ![](https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png | width=100)
@tangzhen
tangzhen / ObjectMapper+Alamofire+RxSwift
Last active June 21, 2016 22:05 — forked from billwang1990/ObjectMapper+Alamofire+RxSwift
ObjectMapper+Alamofire+RxSwift
//
// RxAlamofireObjectMapper.swift
//
// Edit by TangZhen on 06/19/16.
// Forked from https://gist.github.com/billwang1990/a0e20919e7add7aafd8e
// Copyright © 2016 ztang.pub All rights reserved.
//
import Foundation
import Alamofire
@tangzhen
tangzhen / optional.feature
Created July 10, 2016 01:18 — forked from basti1302/optional.feature
Use an optional parameter in Cucumber
Feature: Optional parameter
Scenario: Use an optional parameter
When I execute a step
When I execute a step with the optional parameter whatever
# Check out editorconfig.org for the deets
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@tangzhen
tangzhen / Count lines of code in Xcode project
Created July 27, 2017 06:42 — forked from Tokuriku/Count lines of code in Xcode project
Count lines of code in SWIFT Xcode project
1. Open Terminal
2. cd to your Xcode project
3. Execute the following when inside your target project:
find . -name "*.swift" -print0 | xargs -0 wc -l