Skip to content

Instantly share code, notes, and snippets.

View studiomaestro's full-sized avatar

Masakazu Ishibashi studiomaestro

View GitHub Profile
@studiomaestro
studiomaestro / javascript
Last active December 11, 2015 20:29
Javascript Basics
$ v8
V8 version 3.1.2
> []+[]
> []+{}
[object Object]
> {}+[]
0
> {}+{}
NaN
@studiomaestro
studiomaestro / gist:4122477
Created November 21, 2012 01:25
Cyber Monday 技術系出版社まとめ
コケる (HTTP/1.1 411 Length Required)
tweepy.update_status('hello')
Accept-Encoding: identity
Host: api.twitter.com
Authorization: OAuth realm="", oauth_nonce="0000000000", oauth_timestamp="1351341634", oauth_consumer_key="XXXXXXXXXX", oauth_signature_method="HMAC-SHA1", oauth_version="1.0", oauth_token="YYYYYYYYYY", oauth_signature="ZZZZZZZZZZ"
通る
@studiomaestro
studiomaestro / akari_server.js
Created January 28, 2012 05:50
redis akari server
var redisd = require('./lib/redisd');
var server = redisd.createServer(function(command) {
this.encode(['わぁい'+command+ ' あかり'+command+'大好き']);
console.log('query', command);
});
server.listen(16379, function() {
console.log('fake redis started');
});
[CFSPIKE ~/work/grails/cf-spike]$ vmc push
Would you like to deploy from the current directory? [Yn]: Y
Application Name: cf-spike
Application Deployed URL: 'cf-spike.cloudfoundry.com'? y
[WARNING] Can't determine the Application Type.
Select Application Type: (Rails, Node, Grails, Sinatra, Spring, Roo or JavaWeb) Grails
Selected Java SpringSource Grails Application
Memory Reservation [Default:512M] (64M, 128M, 256M, 512M, 1G or 2G)
Creating Application: OK
Would you like to bind any services to 'cf-spike'? [yN]: y
[CFSPIKE ~/work/grails/cf-spike]$ vmc services
============== System Services ==============
+---------+---------+-------------------------------+
| Service | Version | Description |
+---------+---------+-------------------------------+
| mysql | 5.1 | MySQL database service |
| redis | 2.2 | Redis key-value store service |
| mongodb | 1.8 | MongoDB NoSQL store |
[CFSPIKE ~]$ vmc create-service mongodb mongotest
Creating Service: OK
[CFSPIKE ~]$ vmc services
============== System Services ==============
+---------+---------+-------------------------------+
| Service | Version | Description |
+---------+---------+-------------------------------+
[CFSPIKE ~]$ vmc services
============== System Services ==============
+---------+---------+-------------------------------+
| Service | Version | Description |
+---------+---------+-------------------------------+
| mysql | 5.1 | MySQL database service |
| redis | 2.2 | Redis key-value store service |
| mongodb | 1.8 | MongoDB NoSQL store |
[CFSPIKE ~]$ vmc frameworks
+---------+
| Name |
+---------+
| node |
| grails |
| spring |
| rails3 |
| sinatra |
[CFSPIKE ~]$ vmc runtimes
+--------+-------------+-----------+
| Name | Description | Version |
+--------+-------------+-----------+
| node | Node.js | 0.4.5 |
| java | Java 6 | 1.6 |
| ruby18 | Ruby 1.8 | 1.8.7 |
| ruby19 | Ruby 1.9 | 1.9.2p180 |
+--------+-------------+-----------+