View twitter_fav.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import sys, tweepy, urllib, urllib2, simplejson
consumer_key = ""
consumer_secret = ""
access_key = ""
access_secret = ""
def getAuth():
auth = tweepy.OAuthHandler(consumer_key,consumer_secret)
auth.set_access_token(access_key,access_secret)
View proccessing_on_canvas.py
<!DOCTYPE html>
<html>
<head>
<title>Processing</title>
<meta charset="utf-8">
</head>
<body>
<canvas width="500" height="400"></canvas>
<script src="js/processing-1.1.0.min.js"></script>
View fragment_url.js
/*
* https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js
* https://github.com/cowboy/jquery-hashchange/raw/v1.3/jquery.ba-hashchange.js
*/
(function($){
var tab1 = function() {
$("#tab1").hide();
$("#tab2").hide();
$.ajax({
url: "change_tabs",
View dynamic_define_method.py
lang_list = ["python",
"ruby"]
class Language():
pass
for lang in lang_list:
def _get_language(self, lang=lang):
return "[language] %s" % (lang)
setattr(Language, "get_" + lang, _get_language)
View dict_to_string.py
"&".join([k+"="+v for k, v in params.items()])
View vows_intro.coffee
# coffee version of vows intro in http://vowsjs.org/
exports.Strawberry = () ->
this.color = '#ff0000'
exports.Strawberry.prototype =
isTasty: () -> true
exports.Banana = ()->
this.color = '#fff333'
View favter.rb
#coding: utf-8
require 'twitter'
Twitter.configure do |config|
config.consumer_key = YOUR_CONSUMER_KEY
config.consumer_secret = YOUR_CONSUMER_SECRET
config.oauth_token = YOUR_OAUTH_TOKEN
config.oauth_token_secret = YOUR_OAUTH_TOKEN_SECRET
end
View a_smart_dashboard_have_my_id.user.js
// ==UserScript==
// @name A smart dashboard have my id
// @namespace http://mitukiii.jp/
// @description TumblrのDashboardで自分からReblogされた/自分のidを含んだpostを折り畳むスクリプト
// @include http://www.tumblr.com/dashboard*
// @author mitukiii
// @compatibility Firefox 5.0(Scriptish 0.1), Chrome 12.0.742.112, Opera 11.50
// @charset UTF-8
// @version 0.0.2.20110707180600
// ==/UserScript==
View 0normal.coffee
# 不幸になる書き方
get_timeLine = ()->
xhr = Ti.Network.createHTTPClient
xhr.open 'GET', 'http://example.com/timeline.json'
xhr.onload = ()->
res = JSON.parse(@responseText)
for v in res
# ここでforとか回してゴリゴリviewを作っていく
# addeventlistenerが多いなど複雑なviewだとonload内が肥大する
# どこがviewを作っているコードとロジックがごちゃごちゃ
View snake_to_camel_case.js
function convertSnakeToCamelCase(str) {
return str.replace(/_([a-z])/g, function(){return RegExp.$1.toUpperCase()});
}