Skip to content

Instantly share code, notes, and snippets.

View wcc526's full-sized avatar

chi-chi weng wcc526

View GitHub Profile
@wcc526
wcc526 / javascript.md
Created September 26, 2015 12:10
javascript.md

switch

var grade = "Preminum";

switch(grade){
    case "Regular":
        alert("It is ok");
    case "Priminum":
 alert("It is ok");
@wcc526
wcc526 / ajax.md
Created September 26, 2015 12:09
ajax
$.ajax({
    url: "http://query.yahooapis.com/v1/public/yql",
    // the name of the callback parameter, as specified by the YQL service
    jsonp: "callback",
    // tell jQuery we're expecting JSONP
    dataType: "jsonp",
    // tell YQL what we want and that we want JSON
    data: {
 q: "show tables",
@wcc526
wcc526 / nodejs.md
Created September 26, 2015 12:09
nodejs

Handlebars.js

参考自ghostchina

value

<div class="demo">
<h1>{{name}}</h1>
{{content.title}}
@wcc526
wcc526 / angularjs.md
Created September 26, 2015 12:06
angularjs

search , order and direction

<div class="search">
    <input ng-model="query" placeholder="Search for artists" autofocus>
    <label class="formgroup">by:
        <select ng-model="artistOrder">
            <option value="name"> Name </option>
            <option value="reknown"> Reknown </option>
 
@wcc526
wcc526 / jquery.md
Created September 26, 2015 12:05
jquery

unbind

$('button')
.bind('click',clickListener)
.bind('click',otherListener);

// unbind all click listeners
$('button').unbind('click');
@wcc526
wcc526 / bootstrap.md
Created September 26, 2015 12:05
bootstrap

javascript

<script type="text/javascript">
$("#loading-button").click(function(){
    var btn=$(this);
    btn.button('loading');
    setTimeout(function(){
        btn.button('reset');
 },3000);
@wcc526
wcc526 / ruby_adapter.md
Created September 26, 2015 06:59
ruby adapter
@wcc526
wcc526 / ruby_index.md
Created September 26, 2015 06:58
ruby_index.md

Ruby Syntax

  • 編輯器設定 soft tab (space=2),以 2 格空白符號做為程式內縮距離(不分語言)。
Sublime Text2 設定, Settings Default => 
// The number of spaces a tab is considered equal to
"tab_size": 2,

// Set to true to insert spaces when tab is pressed
@wcc526
wcc526 / ruby_base.rb
Created September 26, 2015 06:56
ruby_base
require 'benchmark'
puts Benchmark.measure { 10000.times { print "." } }
Benchmark.bm do |x|
x.report('some test') {
N.times { some_test }
}
end
@wcc526
wcc526 / css.md
Created September 26, 2015 06:51
css.md