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 -*- | |
import sys | |
import traceback | |
import datetime | |
from dateutil.parser import parse | |
import pytz | |
import json | |
import tweepy |
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
uuid = require 'node-uuid' | |
hex1str = uuid.v4().replace(/-/g, "") | |
hex1buf = new Buffer(hex1str, "hex") | |
hex2str = uuid.v4().replace(/-/g, "") | |
hex2buf = new Buffer(hex2str, "hex") | |
result = new Array() | |
for i in [0...hex1buf.length] | |
r = hex1buf[i] ^ hex2buf[i] | |
result.push r |
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
// AssetsLibrary.frameworkを追加し、 | |
// .hで@property (nonatomic, strong) ALAssetsLibrary *library;とか宣言しておく | |
// 以下は、カメラロール内のある時点以降の画像をすべてUITableViewに表示しようとしている例 | |
-(void)initAssetsLibrary | |
{ | |
// TODO 保存時刻古い順でソートしたい → AssetsLibrary標準のAPIではできない | |
static dispatch_once_t pred = 0; | |
dispatch_once(&pred, ^{ | |
self.library = [[ALAssetsLibrary alloc] init]; |
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
// 与えられた正方形のImageViewと1から0のパーセント値に対して、タコメーター風の円弧を描くメソッド | |
- (void)drawArcToUIImageView:(UIImageView *)targetImageView withPercntage:(CGFloat)percnt | |
{ | |
targetImageView.layer.needsDisplayOnBoundsChange=YES; | |
UIGraphicsBeginImageContext(targetImageView.frame.size); | |
struct CGContext *context = UIGraphicsGetCurrentContext(); | |
CGPoint arcCenter = CGPointMake(targetImageView.frame.size.width/2, targetImageView.frame.size.height/2); | |
CGFloat outerRadius = (targetImageView.frame.size.width/2.0f)-1.0f; | |
CGFloat innerRadius = (targetImageView.frame.size.width/2.0f)-4.0f; |
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
if [ $# -ne 1 ]; then | |
echo "usage: ustreamdump.sh channenName" | |
exit 1 | |
fi | |
chid=$(wget http://api.ustream.tv/json/channel/${1}/getInfo?key=yourDevKey -q -O -|grep -Po '"id":[0-9]*?,'|grep -Po '[0-9]*') | |
if [ ! ${chid} ]; then | |
echo "api error, channelName: ${1}" | |
exit 1 | |
fi |
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
rtmpdump -v -r “rtmp://flash83.ustream.tv:1935/ustreamVideo/5883040/streams/live” -a "ustreamVideo/5883040" -y "streams/live" -f “LNX 10,1,58,3” -o `date +%s`.flv --stop 10 |
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 EnableGoogleWebHistory | |
// @author mallowlabs | |
// @namespace http://mallowlabs.s206.xrea.com/ | |
// @version 0.0.2 | |
// @license public domain | |
// @description : Enable Google Web History | |
// @published 2007-01-05 | |
// @modified 2006-01-05 | |
// @include * |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head profile="http://selenium-ide.openqa.org/profiles/test-case"> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<link rel="selenium.base" href="http://www.facebook.com/" /> | |
<title>facebook event</title> | |
</head> | |
<body> | |
<table cellpadding="1" cellspacing="1" border="1"> |
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 -*- | |
# http://sushi-yuiseki.dotcloud.com/ | |
require 'rubygems' | |
require 'rack' | |
require 'sinatra' | |
require 'redis' | |
require 'json' | |
configure do | |
set :public_folder, 'public' |
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
require "rubygems" | |
require "open-uri" | |
require "json" | |
require "google_spreadsheet" | |
# sudo gem install google-spreadsheet-ruby | |
if ARGV.size > 0 | |
google_name = ARGV[0] | |
google_password = ARGV[1] | |
else |