Skip to content

Instantly share code, notes, and snippets.

@justoneplanet
justoneplanet / connect-twitter.js
Created October 11, 2011 17:09
node.jsでtwitterのstreamにhttpsで接続する
var auth = 'Basic ' + new Buffer('username:password').toString('base64');
var options = {
"host" : "stream.twitter.com",
"port" : 443,
"path" : "/1/statuses/filter.json?follow=123456789",
"method" : "GET",
"Authorization" : auth
};
var request = https.request(
@justoneplanet
justoneplanet / jquery-box-scroll.js
Created October 3, 2011 15:17
overflow: scrollの時にsmooth scrollする簡易プラグイン
$.fn.boxScroll = function(binder, target){
if(binder.attr('data-locked') === 'true'){
return;
}
this.animate(
{"scrollTop" : target.positionIn(binder).top},
1500,
"easeOutExpo",
function(){
binder.attr('data-locked', 'false');
@justoneplanet
justoneplanet / streaming.js
Created August 20, 2011 14:45
Push Earthquake Early Warning through WebSocket.
/**
* Mitsuaki Ishimoto
* Push a message of Earthquake Early Warning
* Using WebSocket-Node
* @see: https://github.com/Worlize/WebSocket-Node
/*=================================================================*/
var sys = require('sys');
var eew = require('../eew.js');
var https = require('https');