This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
var http = require('http'); | |
var connect = require('connect')(); | |
var router = require('flask-router')(); | |
connect.use(require('serve-static')('public')); | |
connect.use(router.route); | |
router.get('/', function(req, res) { | |
res.write('yeah'); | |
res.end(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
viewController.userInteractionEnabled = true すると viewController.touchBegan メソッドが呼ばれるようになる。でも viewController.view を触ったときだけで、subview を触っても呼ばれない。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class ViewController: UIViewController { | |
var red : UIView? | |
var blue : UIView? | |
var green : UIView? | |
var current : Int? | |
override func viewDidLoad() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install querySelector command | |
wget -O tmp.zip https://github.com/piglovesyou/jsdom/archive/master.zip | |
unzip tmp.zip | |
npm install jsdom-master -g | |
rm -rf tmp.zip jsdom-master | |
# Scrape something | |
Dir=result | |
mkdir -p $Dir | |
for N in `seq 1 13`; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Q = require('q'); | |
var pool = []; | |
while (pool.length < 45) pool.push('yeah' + pool.length); | |
doConcurrent(sampleTask, pool, 8) | |
.then(console.log); | |
function doConcurrent(task, pool, concurrent) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var itemHeight = 47; | |
var MyListItem = React.createClass({ | |
render: function render() { | |
var style = { | |
top: this.props.index * itemHeight | |
}; | |
return ( | |
<div className="listitem" style={style}> | |
item{this.props.index}.. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
goog.require('goog.Promise'); | |
delay(6) | |
.then(multiply); | |
// 36 | |
delay('yeah') | |
.then(multiply); | |
// main.js:9: WARNING - actual parameter 1 of goog.Promise.prototype.then does not match formal parameter | |
// found : function (number): undefined |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var co = require('co'); | |
var Q = require('q'); | |
delay(400) | |
.then(console.log) | |
.then(delay.bind(null, 400)) | |
.then(console.log) | |
.then(delay.bind(null, 400)) | |
.then(console.log) | |
.catch(err => console.error(err.stack)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.List; | |
import org.mozilla.javascript.Function; | |
import org.mozilla.javascript.Context; | |
import org.mozilla.javascript.Scriptable; | |
import org.mozilla.javascript.commonjs.module.Require; | |
import org.mozilla.javascript.tools.shell.Global; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.List; | |
import java.lang.StringBuffer; | |
import org.mozilla.javascript.Function; | |
import org.mozilla.javascript.Context; | |
import org.mozilla.javascript.Scriptable; | |
import org.mozilla.javascript.commonjs.module.Require; | |
import org.mozilla.javascript.tools.shell.Global; |