Skip to content

Instantly share code, notes, and snippets.

@tanabe
tanabe / gist:6439079
Last active December 22, 2015 07:38
install Imager::File::JPEG
Hummingbird:~ tanabe$ cpanm Imager::File::JPEG
--> Working on Imager::File::JPEG
OKtching http://search.cpan.org/CPAN/authors/id/T/TO/TONYC/Imager-File-JPEG-0.88.tar.gz ...
==> Found dependencies: Imager
--> Working on Imager
Fetching http://search.cpan.org/CPAN/authors/id/T/TO/TONYC/Imager-0.97.tar.gz ... OK
Configuring Imager-0.97 ... OK
Building and testing Imager-0.97 ... OK
Successfully installed Imager-0.97 (upgraded from 0.85)
Configuring Imager-File-JPEG-0.88 ... N/A
@tanabe
tanabe / gist:5230703
Created March 24, 2013 05:38
post mixi voice using XMLHttpRequest
var requestParams = {"jsonrpc":"2.0","method":"jp.mixi.voice.create","params":{"viewer_id":"xxx","owner_id":"xxx","body":"abc","twitter_sync":0,"privacy":{"name":"friend"},"via":18,"guidance_id":"3"},"id":0};
var xmlHttpRequest = new XMLHttpRequest();
xmlHttpRequest.open('POST', 'http://mixi.jp/system/rpc.json?auth_type=postkey&secret=xxx');
xmlHttpRequest.send(JSON.stringify(requestParams));
@tanabe
tanabe / gist:4978553
Last active December 13, 2015 21:38
run crowy on Mac OS X
* download GAE
** https://developers.google.com/appengine/downloads
* create new Twitter application
** https://dev.twitter.com/apps/new
** need callback url
** Application Type is Read and Write
* clone Crowy
** git clone git@github.com:co-meeting/crowy.git
* edit src/conf/settings.py
* run Crowy
(function() {
var memberId;
var ie = WScript.CreateObject('InternetExplorer.Application');
ie.Visible = true;
var openURL = function(url, callback) {
ie.Navigate(url);
while (ie.ReadyState != 4) {
WScript.Sleep(200);
}

mogemoge


hogehogehogeaaaaaaaaaa

see Wikipedia

Markdown is a lightweight markup language, originally created by John Gruber and Aaron Swartz allowing people "to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML)".

@tanabe
tanabe / gist:2993217
Created June 26, 2012 04:06
display off cnet splash ad
(function() {
document.getElementById('block_elu').style.display = 'block';
document.getElementById('splash').style.display = 'none';
})();
mod control += 英数
key *英数 = *LeftControl
mod control -= LeftControl
key *LeftControl = *英数
@tanabe
tanabe / gist:2918306
Created June 12, 2012 15:45
phantom.js webserver
(function() {
var server = require('webserver').create();
var service = server.listen(9876, function (request, response) {
var fs = require('fs');
var file = fs.read(fs.workingDirectory + request.url);
response.statusCode = 200;
response.headers['Content-Type'] = 'text/html';
response.write(file);
response.close();
});
404 - I don't know
A3 - Anytime, anywhere, anyplace
AAP - Always a pleasure
AAR - At any rate
AAS - Alive and smiling
ADD - Address
ADN - Any day now
AEAP - As early as possible
AFAIK - As far as I know
AFK - Away from keyboard
@tanabe
tanabe / gist:1899926
Created February 24, 2012 10:10
buggy component
//1 to 4
Component.prototype.initialize = function(element) {
//not good
//4. this handler is still alive.
model.method("create").observe(this.handler);
};
Component.prototype.handler = function() {
//not good