Skip to content

Instantly share code, notes, and snippets.

View poychang's full-sized avatar
🏠
Stay Home & Be Health

Poy Chang poychang

🏠
Stay Home & Be Health
View GitHub Profile
@poychang
poychang / angularjs-providers-explained.md
Created March 9, 2016 00:16 — forked from demisx/angularjs-providers-explained.md
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@poychang
poychang / angularPlugin.js
Created April 5, 2016 05:34 — forked from loicknuchel/angularPlugin.js
Angular MediaSrv : play audio with Cordova & Ionic apps
angular.module('my.cordova.plugins', ['ionic'])
// for media plugin : http://plugins.cordova.io/#/package/org.apache.cordova.media
.factory('MediaSrv', function($q, $ionicPlatform, $window){
var service = {
loadMedia: loadMedia,
getStatusMessage: getStatusMessage,
getErrorMessage: getErrorMessage
};
@poychang
poychang / addAndroidResource.js
Last active June 11, 2016 14:34
Create Android resource for app name
#!/usr/bin/env node
/* jshint esversion: 6 */
// ref: https://developer.android.com/training/basics/supporting-devices/languages.html
// Save hook under `project-root/hooks/after_compile/`
//
// Don't forget to install xml2js using npm
// `$ npm install xml2js`
@poychang
poychang / 010_jshint.js
Last active July 1, 2016 07:58
Cordova hook with JSHint
#!/usr/bin/env node
var fs = require('fs');
var path = require('path');
var jshint = require('jshint').JSHINT;
var async = require('async');
var recursiveFolderSearch = true;
var foldersToProcess = [
'js'
@poychang
poychang / instcat.sql
Created July 19, 2016 03:18
解決從 64 位元 SQL Server 用戶端對連結 32 位元 SQL Server 伺服器執行分散式查詢時,可能會收到錯誤訊息
This file has been truncated, but you can view the full file.
/*
** INSTCAT.SQL
** Installs catalog stored procedures on the Microsoft SQL Server.
** Copyright Microsoft, Inc. 1994 - 2000
** All Rights Reserved.
**
** Owners:
**
** <owner current="true" primary="true">iliak</owner>
*/
@poychang
poychang / rename.bat
Created July 19, 2016 09:48
投影片另存成圖檔時,想將檔名變更為 001~999,可透過此批次檔做變更
@echo off
setlocal EnableDelayedExpansion
set/p key=確定要執行此更名工具?(y/n):
if /i "%key%"=="n" goto END
set i=0
rem 依序重新命名
for %%a in (投影片?.jpg) do (
set /a i+=1
@poychang
poychang / .gitignore
Last active September 19, 2016 06:59
This gitignore file is for a general web project
# -----------------------------------------------------------------
# Specifies intentionally untracked files to ignore when using Git
# http://git-scm.com/docs/gitignore
#
# This file is tailored for a general web project
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/poychang/128d62787f1bf5a60fcdafcb5d223b70/raw/.gitignore
# to download this file
#
@poychang
poychang / uglify.js
Last active December 6, 2016 08:18
使用 cordova-uglify 時出現路徑問題,需增加 process.cwd() 取得執行路徑,才能正常運作
#!/usr/bin/env node
/*jshint latedef:nofunc, node:true*/
// Modules
var fs = require('fs');
var path = require('path');
var cwd = process.cwd();
var dependencyPath = path.join(cwd, 'node_modules', 'cordova-uglify', 'node_modules');
// cordova-uglify module dependencies
@poychang
poychang / github_member_developer
Created March 3, 2017 00:06 — forked from belm/github_member_developer
GitHub 多人协作开发
GitHub 多人协作开发 三种方式:
一、Fork 方式 网上介绍比较多的方式(比较大型的开源项目,比如cocos2d-x)
开发者 fork 自己生成一个独立的分支,跟主分支完全独立,pull代码后,项目维护者可根据代码质量决定是否merge代码
此方式网上方法比较多,这里不详细描述
有两种常用的方法在GitHub上建立团队合作:
二、组织 – 组织的所有者可以针对不同的代码仓库建立不同访问权限的团队。
Accounts Settings => Organizations =>Create new Organizations 新建一个组织 然后添加项目成员,根据提示设置完毕即可。
新建一个Repository 新建完毕后 进入Repository的Settings =>Collaborators 在Teams下面点击刚创建的组织 比如eveloper-51/owners
@poychang
poychang / ChromeConsoleTricks.html
Created March 5, 2017 14:37
使用 Chrome Console 的小技巧
<!DOCTYPE html>
<html lang="en">
<head>
<title>Chrome Console Tricks!</title>
</head>
<body>
<p onclick="makeGreen()">BREAK DOWN</p>
<script>