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 canvas = document.createElement('canvas'); | |
canvas.width = 768; | |
canvas.height = 1024; | |
document.body.appendChild(canvas); | |
var context = canvas.getContext('2d'); | |
context.fillStyle = 'red'; | |
context.fillRect(100,100,100,100); |
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
UITapGestureRecognizer *doubleTapGestureRecognizer; | |
doubleTapGestureRecognizer = [[UITapGestureRecognizer alloc] | |
initWithTarget:self action:@selector(_doubleTapAction:)]; | |
doubleTapGestureRecognizer.numberOfTapsRequired = 2; | |
[cell addGestureRecognizer:doubleTapGestureRecognizer]; | |
UITapGestureRecognizer *singleTapGestureRecognizer; | |
singleTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_singleTapAction:)]; | |
singleTapGestureRecognizer.numberOfTapsRequired = 1; | |
[singleTapGestureRecognizer requireGestureRecognizerToFail:doubleTapGestureRecognizer]; |
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 MOON = require('phantoMOON'); | |
var directory = '90PC2AlZ1375836774851'; | |
MOON.setCurrentPage(directory); | |
var page = MOON.getCurrentPage(); | |
var backing = page.backing; | |
console.log(backing); | |
var paperJSON = MOON.getPaperJSON(backing); | |
console.log(paperJSON); |
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 fs = require("fs"); | |
var _currentBacking; | |
exports.setCurrentPage = function(backing){ | |
_currentBacking = backing; | |
}; | |
exports.getCurrentPage = function(){ | |
var path = './' + _currentBacking + '/info.json'; |
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 f = function(){ | |
var core = new Core(320, | |
320 | |
); | |
core.onload = function(){ | |
var sprite = new Sprite(32, 32); | |
sprite.x = 100; | |
sprite.y = 100; | |
sprite.backgroundColor = 'blue'; | |
sprite.tl.moveTo(768 * 0.5 - 32, |
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
/** | |
* Module dependencies. | |
*/ | |
var express = require('express') | |
, routes = require('./routes') | |
, user = require('./routes/user') | |
, http = require('http') | |
, path = require('path'); |
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 evalRemoteCode = function(){ | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', BASE_URL + '/code', true); | |
xhr.onreadystatechange = function(){ | |
if(xhr.readyState === 4){ | |
var code = xhr.response; | |
console.log('got code:' + code); | |
console.log(eval(code)); | |
} | |
}; |
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
importJS(["lib/MOON.js", "lib/enchant.js", "lib/ui.enchant.js", "lib/color.enchant.js", | |
"lib/stylus.enchant.js", "lib/puppet.enchant.js", "lib/moon.puppet.enchant.js"], | |
function() { | |
enchant(); | |
var sticker = Sticker.create(); | |
sticker.onattach = sticker.ondetach = function() { | |
MOON.finish(); | |
}; | |
sticker.ontap = function() { |
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
/* | |
Simple CFAllocator example program, demonstrating creation and use of custom CFAllocators. | |
Author: Ali Ozer | |
7/7/99 | |
Copyright (c) 1999-2004, Apple Computer, Inc., all rights reserved. | |
*/ | |
/* | |
IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in | |
consideration of your agreement to the following terms, and your use, installation, |
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
//クラス(すべて)に追加 | |
[UIView insertPreprocessToSelector:@selector(method:) | |
block: | |
^{ | |
NSLog(@"YES"); | |
}]; | |
//このインスタンスだけに追加 | |
[view insertPreprocessToSelector:@selector(method:) |