Updated for Rails 4.0.0+
-
Set up the
bowergem. -
Follow the Bower instructions and list your dependencies in your
bower.json, e.g.// bower.json
{
| runtime: go | |
| api_version: go1 | |
| handlers: | |
| - url: /.* | |
| script: _go_app |
| # shortform git commands | |
| alias g='git' | |
| # count relevant lines of shell code in a git repo | |
| egrep -v '^\s*($|#)' $(git grep -l '#!/bin/.*sh' *) | wc -l | |
| # push all remotes | |
| for i in `git remote`; do git push $i; done; | |
| # cherry pick range of commits, starting from the tip of 'master', into 'preview' branch |
Updated for Rails 4.0.0+
Set up the bower gem.
Follow the Bower instructions and list your dependencies in your bower.json, e.g.
// bower.json{
| BetterErrors.editor = :macvim if defined? BetterErrors |
| function slowCall() { | |
| var df = $q.defer(); | |
| // 非同期処理を担当する関数を定義 | |
| function fn() { | |
| var msg = 'now : ' + new Date().getTime(); | |
| alert('inside async function.'); | |
| df.resolve(msg); | |
| }; | |
| $timeout(fn, 1000); | |
| return df.promise; |
| # coding: utf-8 | |
| class MatrixSum | |
| def self.sumup_numbers(input) | |
| # 行の合計を計算 | |
| input_with_row_sum = input.map do |list| | |
| append_sum_to_last(list) | |
| end |
| def patatokukashi(words) | |
| line1 = [] | |
| line2 = [] | |
| words.chars.each_slice(2) do |a,b| | |
| line1.push(a) | |
| line2.push(b) | |
| end | |
| line1.join("") + line2.join("") | |
| end |
| // socket io | |
| var app = require('http').createServer(handler), | |
| io = require('socket.io').listen(app), | |
| fs = require('fs'); | |
| app.listen(3000, function() { | |
| console.log('Socket IO Server is listening on port 3000'); | |
| }); | |
| function handler(req, res) { |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <fcntl.h> | |
| #include <string.h> | |
| #include <termios.h> | |
| #include <time.h> | |
| #define DEV_NAME "/dev/tty.usbmodem621" | |
| #define BAUD_RATE B9600 |
| for(int i=0; i < numMember; i++) { | |
| Sushi sushi = new Sushi(); // 勝手にランダムな寿司が出来上がるものとする | |
| dishes.add(sushi); | |
| sushi = null; // ここでどうなる? | |
| } |