Skip to content

Instantly share code, notes, and snippets.

View e-jigsaw's full-sized avatar

jigsaw e-jigsaw

View GitHub Profile
// ==UserScript==
// @name Social count(jigsaw tune)
// @namespace http://about.me/jigsaw
// @include http://*
// ==/UserScript==
(function() {
if (window.top != window.self) exit;
var body = document.body;
@e-jigsaw
e-jigsaw / yky_code.js
Created January 2, 2012 15:32
New year card coding!
var str = ["HOGE", "SOME", "TEXT", "IN", "HERE", "PIYO"];
for(var t in str) {
var c = t + 2;
t = parseInt(t);
console.log(t+1);
for(var i in str[t]) {
var right = str[t].charCodeAt(i) + (t+1);
var left = str[t].charCodeAt(i) - (t+1);
if(right > 90) right -= 26;
if(left < 65) left += 26;
@e-jigsaw
e-jigsaw / server.js
Created February 5, 2012 16:55
Play song in Server and Share with Dropbox!
var exec = require('child_process').exec;
var spawn = require('child_process').spawn;
function playSong() {
exec("ls *.mp3 *.m4a", function(e, stdo, stde) {
var tmp = stdo.split("¥n");
if(tmp.length == 1) return;
var afplay = spawn("afplay", [tmp[0]]);
afplay.on("exit", function(e) {
exec("rm -f "+tmp[0], function(){
@e-jigsaw
e-jigsaw / ykybot.js
Created February 11, 2012 12:31
Skype bot a.k.a. ukeip
var skype = new ActiveXObject("Skype4COM.Skype");
WScript.ConnectObject(skype, "Skype_");
skype.Attach();
while(true){
WScript.Sleep(1000);
}
function Skype_MessageStatus(msg, status){
if(status == skype.Convert.TextToChatMessageStatus("RECEIVED")){
@e-jigsaw
e-jigsaw / kove_pjax.js
Created March 28, 2012 14:40
pjax example
$.ajax({ // jQueryつかってるよー!
url: urldayo, // url指定するよー!
dataType: "html", // なんかこんな指定するらしーよー
beforeSend: function(xhr) { // pjaxのヘッダつけるよー!
xhr.setRequestHeader("X-PJAX", "true"); // わーわー!
}, // とじたよ!
success: function(data) { // 通信が成功したときの処理をかくよ!
$(container).html(data); // container(layoutはかきかえないよ!)に送られてきたデータをつっこむよ!
history.pushState(null, "titledayo", urldayo); // pushStateの設定したらブラウザの戻るで戻ったときに表示がおかしくなったりしなくなるよ!
} // エラーの処理とかはとりあえずスルーだよ!
@e-jigsaw
e-jigsaw / gist:2277968
Created April 1, 2012 19:31 — forked from asonas/gist:2277947
高専クリエイターズ
適当なコミュニティサイトをつくる。
そこで高専な人で普段からものづくりしてる人があつまる
誰かが企画書を投げると、その企画に参加したい人たちが参加していくある程度人数や役割がそろったら開発開始。
作業の内容は常にgitのコミットログがそのコミュニティサイトに流れてくる。
流動性をどんどん見せるための演出がすごくあるといいかも。
すべてのプロジェクトのコミットログがトップページに流れてくると脳汁やばい。
成果物もURLを付記してどんどん完成していく姿が見える
@e-jigsaw
e-jigsaw / ukemionsiri.rb
Created May 29, 2012 08:16
Ukemi on Siri
# -*- encoding: utf-8 -*-
require 'cora'
require 'siri_objects'
require 'pp'
require 'open-uri'
// なんやかんや
listen_for /.*/u do
open("うけみちゃんのurl") {|f|
@e-jigsaw
e-jigsaw / 2011_06.csv
Created December 20, 2012 08:16 — forked from anonymous/2011_06.csv
ログインしてないの気付かなくてanonymousになっちゃってた〜
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 9 columns, instead of 8. in line 1.
"tweet_id","in_reply_to_status_id","in_reply_to_user_id","retweeted_status_id","retweeted_status_user_id","timestamp","source","text","expanded_urls"
"86448894229217280","","","","","2011-06-30 14:59:57 +0000","<a href=""http://sites.google.com/site/yorufukurou/"" rel=""nofollow"">YoruFukurou</a>","???????"
"86445444418379776","","","86445312020975616","10177512","2011-06-30 14:46:14 +0000","<a href=""http://sites.google.com/site/yorufukurou/"" rel=""nofollow"">YoruFukurou</a>","RT @abolabo: ?6???DJ?????????????DJ?????? ?????? http://lockerz.com/s/115613217"
.
.
.
(function() {
"use strict";
var app = WinJS.Application;
app.onactivate = function(args) {
Windows.ApplicationModel.DataTransfer.DataTransferManager.getForCurrentView().addEventlistener("datarequested", shareHandler);
// なんやかんや
};
do ->
AppViewModel = ->
this.some
...
this.hoge
...
this # ←これがないとbindしてくれない
ko.applyBindings new AppViewModel()