This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"&".join([k+"="+v for k, v in params.items()]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coffee version of vows intro in http://vowsjs.org/ | |
exports.Strawberry = () -> | |
this.color = '#ff0000' | |
exports.Strawberry.prototype = | |
isTasty: () -> true | |
exports.Banana = ()-> | |
this.color = '#fff333' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 不幸になる書き方 | |
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を作っているコードとロジックがごちゃごちゃ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convertSnakeToCamelCase(str) { | |
return str.replace(/_([a-z])/g, function(){return RegExp.$1.toUpperCase()}); | |
} |
OlderNewer