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 DateTime = function() { | |
var now = new Date(); | |
this.year = now.getFullYear(); | |
this.month = ('00' + now.getMonth()).slice(-2); | |
var monthEndDate = new Date(this.year, this.month, 0); | |
this.startDate = this.year + '-' + this.month + '-01'; | |
this.endDate = this.year + '-' + this.month + '-' + monthEndDate.getDate(); | |
} | |
var Profile = function(profileName, tableId) { |
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
use AnyEvent; | |
use AnyEvent::HTTP; | |
my $w; | |
my $cv = AE::cv; | |
my @urls = qw{ | |
http://localhost:5000/ | |
http://localhost:5001/ | |
}; | |
my @watchers; |
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
def myset(a1, a2) | |
h = Hash.new(0) | |
a1.each{|a| h[a] += 1} | |
a2.each{|a| h[a] += 1} | |
puts "a and b" | |
p h.select{|k, v| v == 2}.keys | |
puts "a or b" | |
p h.keys |
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
player.intersectScale = function(other) { | |
return this.x < other.x + (other.width * other.scaleX) && | |
other.x < this.x + (this.width * this.scaleX) && | |
this.y < other.y + (other.height * other.scaleY) && | |
other.y < this.y + (this.height * this.scaleY); | |
}; |
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
wget -q -O - https://raw.github.com/gist/2817051/e3e5f4d268994ae4d103329f845b34cb6a54b8df/install_rvm_1.9.3_on_Ubuntu_10.04.sh | bash |
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
wget -q -O - https://raw.github.com/gist/2204072/4fe9d4a62921865005ab19ee4f90c67f27ec58cb/install_tmux_1.6_on_ubuntu_10.04.sh | sudo bash |
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
play console [info] Loading project definition from /private/tmp/todolist/project | |
[info] Set current project to todolist (in build file:/private/tmp/todolist/) | |
[info] Starting scala interpreter... | |
[info] | |
Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_35). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> new play.core.StaticApplication(new java.io.File(".")) | |
[info] play - database [default] connected at jdbc:postgresql://localhost:5432/todolist |
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
package models | |
import play.api.libs.ws.WS.WSRequestHolder | |
import play.api.libs.ws.WS.url | |
import play.api.libs.concurrent.Promise | |
import play.api.libs.ws.Response | |
object Qiita { | |
def getTags = { | |
val wsRequestHolder: WSRequestHolder = url("https://qiita.com/api/v1/tags") |
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 http = require('http'); | |
server = http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('Hello World\n'); | |
server.close(); | |
}); | |
server.listen(8080, 0, function () { | |
console.log('Server running at http://localhost:8080/'); | |
}); |
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
% heroku run bash | |
Running `bash` attached to terminal... up, run.4287 | |
~ $ cat /etc/lsb-release | |
DISTRIB_ID=Ubuntu | |
DISTRIB_RELEASE=10.04 | |
DISTRIB_CODENAME=lucid | |
DISTRIB_DESCRIPTION="Ubuntu 10.04 LTS" | |
~ $ |
OlderNewer