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 / useminPrepare.js
Created November 19, 2014 10:02
Add additional options into concat&uglify when use usemin
'use strict';
module.exports = {
html: '<%= config.web %>/index.html',
options: {
dest: '<%= config.dist %>',
flow: {
html: {
steps: {
js: ['concat', 'uglifyjs']
function Get-IniContent ($filePath)
{
$ini = @{}
$content = Get-Content $filePath
if ( $content -match "^\[(.+)\]" ) {
switch -regex -file $FilePath
{
"^\[(.+)\]" # Section
{
$section = $matches[1]
@tangzhen
tangzhen / js-comment-header.js
Created July 18, 2014 07:00
The Javascript Comment Header
//**********************************************************
// Assignment: Program 2
// Account: (Enter your cs110 account number here)
//
// Author: (Enter your full name here)
//
// Completion time: (Enter the total number of hours you
// spent on the assignment)
//
// Honor Code: I pledge that this program represents my own
@tangzhen
tangzhen / cleanup_all_gemsets.sh
Created July 1, 2014 13:22
Cleanup all gem sets
#!/bin/sh
echo "NB! This process could be too destructive sometimes and you may need to run 'bundle' command from your project directory."
echo "Do you want to cleanup all gemsets?"
read -p "(anything other than 'yes' will cancel) > " ANSWER
if [[ $ANSWER != "yes" ]]
then
echo "Phew...\nMay be another day."
else
@tangzhen
tangzhen / mirror.sh
Created June 29, 2014 10:16
Switch NodeJS and Ruby Gem to China Taobao mirror
# switch npm
echo '\n#alias for cnpm\nalias cnpm="npm --registry=registry.npm.taobao.org \
--cache=$HOME/.npm/.cache/cnpm \
--disturl=http://npm.taobao.org/dist \
--userconfig=$HOME/.cnpmrc"' >> ~/.zshrc && source ~/.zshrc
#switch Ruby gem
gem sources --remove https://rubygems.org/
gem sources -a https://ruby.taobao.org/
@tangzhen
tangzhen / Xcode.txt
Created June 28, 2014 10:13 — forked from foundry/.gitignore
git ignore file for Xcode
#########################
# update 4 June 2014
# ignore Pods folder and Podfile.lock
#########################
Pods
Podfile.lock
#########################
# https://gist.github.com/foundry/4383910