This file contains 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 MyClass = (function(){ | |
function MyClass(){} | |
MyClass.prototype.doIt = function(a, b){ | |
console.log('doIt'); | |
this._doProtected(); | |
privates.doSecret.call(this, a, b); | |
}; | |
This file contains 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 _ = require('underscore'); | |
var MyClass = (function(){ | |
function MyClass(){} | |
_.extend(MyClass.prototype, { | |
doIt : function(a, b){ | |
console.log('doIt'); |
This file contains 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 ITEMS = [ | |
{price: 250}, | |
{price: 200}, | |
{price: 150} | |
]; | |
var SET_PRICE = 550; | |
function minCountItem(items){ | |
This file contains 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
//npm install underscore should | |
var _ = require('underscore'), | |
should = require('should'); | |
/** | |
* 今回のサンプルのサービス | |
* @constructor | |
*/ | |
function Service(){}; |
This file contains 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
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
</head> | |
<body> | |
<a href="gamecenter:">ゲームセンター</a> | |
</body> | |
</html> |
This file contains 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
/** | |
* Detecting vertical squash in loaded image. | |
* Fixes a bug which squash image vertically while drawing into canvas for some images. | |
* This is a bug in iOS6 devices. This function from https://github.com/stomita/ios-imagefile-megapixel | |
* | |
*/ | |
function detectVerticalSquash(img) { | |
var iw = img.naturalWidth, ih = img.naturalHeight; | |
var canvas = document.createElement('canvas'); | |
canvas.width = 1; |
This file contains 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
$action.bind('vclick', function(event){ | |
$popup.popup('open', { | |
transition: 'pop', | |
positionTo: event.target | |
}); | |
}); |
This file contains 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 moment = require('moment'); | |
var crypto = require('crypto'); | |
function createS3bucket(params) { | |
function base64_encode(val) { | |
var b = new Buffer(val); | |
return b.toString('base64'); | |
} |
This file contains 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
# キーダウンイベント | |
keydowned: (event)-> | |
@downedKey = event.keyCode | |
# Firefoxでは@downedKeyが日本語変換直前のキーコード | |
# Chrome等では229が入ります。 | |
# キーアップイベント | |
keyupped: (event)-> | |
# enter押下でかつ日本語入力ではない |
This file contains 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
require 'twitter' | |
namespace :twitter do | |
desc "ツイートする" | |
task :tweet => :environment do | |
## アプリ登録時に取得したCONSUMER_KEY/CONSUMER_SECRET | |
CONSUMER_KEY = 'xxxxx' | |
CONSUMER_SECRET = 'xxxxx' | |
## irbで取得したAccess Token/Access Secret | |
OAUTH_TOKEN = 'xxxxx' |
OlderNewer