Skip to content

Instantly share code, notes, and snippets.

@aerith
aerith / result.yaml
Created March 8, 2013 06:51
Twitter の URL 短縮さんはどこにいってしまったのか…。
---
:GET 1:
url: http://t.co/dvXMzvhagS
display_url: example.com
expanded_url: http://example.com/
:POST 1:
request: /1/urls/shorten.json
error: This method requires a GET.
:GET 1.1:
errors:
(function (w, d) {
// See: https://gist.github.com/1250370
// See: http://d.hatena.ne.jp/amachang/20070611/1181554170
var slice = Array.prototype.slice;
var BoxHeight = function (tagName, object) {
this.top = 0;
this.height = 0;
this.target = [];
<?php
function bar ($n) {
return implode('', array_pad(array(), $n, '#')) . implode('', array_pad(array(), 100 - $n, '-'));
}
array_map(function ($i) {
printf('%3d%% [|%s|]', $i, bar($i));
usleep(2000000);
print "\r";
/*
* Use like below
*
* var div = Hoge.create('div', {id: 'hoge'})
* .create('ul')
* .create('li')
* .end()
* .create('li')
* .end()
* .create('li')
<?php
class PhotoService extends AppModel {
public $name => 'PhotoService';
public $useTable = false;
public $actAs = array(
'Transactable' => array(),
dispatcher =
location: window.location
stash: []
connect: (paths, action) ->
if paths or paths is 0
paths = paths.valueOf()
# webkit: typeof RegExp is function
#!/usr/bin/perl
use strict;
use warnings;
use Switch;
use lib qw(/home/aerith/local/bin/twitter/lib);
use JSON::Syck;
use Config::Pit;
<html>
<body>
<script type="text/javascript">
var hoge = function (name) {
function f () {}
var e = document.createElement(name);
f.prototype = e;
@aerith
aerith / index.html
Created December 24, 2011 19:38
instagram 用のデモページ
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" charset="UTF-8"></script>
<title>Play with Instagram - sample</title>
</head>
<body>
<div class="content container">
<a href="https://instagram.com/oauth/authorize/?client_id=[クライアントID]&amp;redirect_uri=[リダイレクト用のURL]&amp;response_type=token">allow the application to use data on instagram</a>
<html>
<head>
<style type="text/css">
.pseudo-radio li {
float: left;
width: 200px;
display: block;
list-style: none;
}