Skip to content

Instantly share code, notes, and snippets.

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

/**
* A generic confirmation for risky actions.
* Usage: Add attributes: ng-really-message="Are you sure"? ng-really-click="takeAction()" function
*/
angular.module('app').directive('ngReallyClick', [function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('click', function() {
var message = attrs.ngReallyMessage;
uploader = $fileUploader.create(
scope: $scope
url: "http://#{$rootScope.api}/proposal/upload"
formData: [{
key: \value
}]
filters: [
(item) ->
if item.size >10000000
alert \size不得超過10mb
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
# var xs = [1,2,3]
# doubleMe(doubleMe(doubleMe(xs)))
#這樣寫法有很多缺點,太多層次要把全部層次讀完才能知道最後結果。
#在墮性語言之中
#我們要做到調用 doubleMe 時並不會立即求值,它會說“嗯嗯,待會兒再做!”
#在真正執行時只會是一個平面,像 xs *2 *2 *2;
(a, b, c) --> a * b * c
#代替了

Movies Recommendation:

Music Recommendation:

@evenchange4
evenchange4 / zsh.md
Last active August 29, 2015 14:16 — forked from tsabat/zsh.md
@evenchange4
evenchange4 / step.md
Created September 24, 2012 06:31
Use Express and Mongolab to create Todo-list on Heroku

Use Express and Mongolab to create Todo-list on Heroku

Step by step from command line by Michael Hsu

Quick start

Clone an express-todo-example code

$ git clone https://github.com/dreamerslab/express-todo-example.git mongolab-todo-list

Link MongoDB Hosting /db.js

  1. create a MongoLab Platform account
@evenchange4
evenchange4 / install-flow
Created September 24, 2012 07:09 — forked from andikan/install-flow
ec2 environment
http://ggd.github.com/blog/2012/07/20/deploy-rails-3-with-apache-mysql-passenger-capistrano-to-ec2/
http://nathanhoad.net/how-to-ruby-on-rails-ubuntu-apache-with-passenger
#ruby :
sudo apt-get install ruby1.9.1-full
#simple compiler
sudo apt-get install build-essential
#mysql
sudo apt-get install mysql-server mysql-common mysql-client libmysqlclient-dev
#ruby mysql adapter
@evenchange4
evenchange4 / traceroute.md
Created September 25, 2012 05:37
traceroute

Trace Routing Website

Mac OSX traceroute

Linux tracert

$ traceroute michaelhsu.tw
traceroute to michaelhsu.tw (66.6.44.4), 64 hops max, 52 byte packets