This file contains hidden or 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
#!/bin/sh | |
GIT='git' | |
if test `uname` = "Darwin" ; then | |
SED_OPT='-E' | |
OPEN='open' | |
else | |
SED_OPT='-r' | |
OPEN='' |
This file contains hidden or 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
> perl -E 'say "生" & "死"' | |
愛 | |
生 Life U+751F \xe7\x94\x9f 11100111 10010100 10011111 | |
死 Death U+6B7B \xe6\xad\xbb 11100110 10101101 10111011 | |
愛 Love u+611B \xe6\x84\x9b 11100110 10000100 10011011 |
This file contains hidden or 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
#define DICT(...) ([NSDictionary dictionaryWithObjectsAndKeys:__VA_ARGS__, nil]) | |
#define MDICT(...) ([NSMutableDictionary dictionaryWithObjectsAndKeys:__VA_ARGS__, nil]) | |
#define FORMAT(...) ([NSString stringWithFormat:__VA_ARGS__]) | |
#define ARRAY(...) ([[NSArray alloc] initWithObjects:__VA_ARGS__, nil]) | |
#define MARRAY(...) ([[NSMutableArray alloc] initWithObjects:__VA_ARGS__, nil]) | |
#define ASSOC(D, K) ([D objectForKey:K]) | |
#define PREDICATE(F, ...) ([NSPredicate predicateWithFormat:F, __VA_ARGS__]) | |
#define LOCALIZED_STRING(S) (NSLocalizedString(S, S)) | |
#define IS_VALID_STRING(s) (s && s != NULL && ![s isEqual:[NSNull null]]) | |
#define CG_RECT_MAKE_SHORT(N) (CGRectMake(N##_X, N##_Y, N##_WIDTH, N##_HEIGHT)) |
This file contains hidden or 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
import urlparse | |
import lxml.html as html | |
import sys | |
import json | |
BLOG_URL = 'http://torufurukawa.blogspot.jp/' | |
def fetch(url): | |
print >>sys.stderr, 'fetcing %s...' % url | |
retry_count = 0 |
This file contains hidden or 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
javascript:(function(d,rd,im,w,h,xx,yy,l,s,f,r,j,t,dg,pt){im.src="data:image/gif;base64,R0lGODlh2AEIAIABAAAAAP///yH5BAEKAAEALAAAAADYAQgAAAL+jI+py+0PYopA0SlD1Wjv11xYR31lZojnp6lrKsIxSNf2Eb+4m59yubugJLrRsILaKY8/j6/ZNPWAraW0CsNWM9zizbJifWmzltiMuY7GuGxQ6Yb/4qT11hRPsvc2ohPehRVoV1eopVc3iCjk98f0eAVJlySZBYnkRyfzFcYxwVdz5mmxIEVZ1qemuSl3F7VaqJInClprl2l5VmnYOtubiPnbCYTrmmuFXMqymxlspiiGCuKRMkptG6JLuxjZPcbUSzUnKNpYdooujY196QJmNeWO1gmbewrmM+x9zM9zL9doXpEZ4lhx+oRn1DpCHBBpsfTqmUMH4CapM4eqWEWoTwXrLQSlL5mhYsL2HaJ1p8e7YOZOSnTE6KIqlxKjOCEYbSKZNhyvfeTF890nmy9RZqs2Us9GciI3Lsv58yezP8YGAXWjcaYkeUnJOTMWCyZVmr4MxhSoVWeoIVijDu2gMGibmy+8rH1KTMeTpPGepjmi1u23bgWp7A2pjBG8vlgxZqX5xCExr1DCdfTLj2xRdmcFT5L70FrPNKE9mz6NOrXq1axbgyoAADs=";yy=h-8;im.onload=function(n,c,di,k,z){n=d.createElement("canvas");n.width=w;n.height=h;n.setAttribute("style","background-color:#ffe;width:512px;height:512px;position:absolute;left:0;top:0");d.body.appendChild(n);d.onkeydown=function(e){k=e.which;return false};d.onkeyup=function(e){k=0};c=n.getContext("2d");funct |
This file contains hidden or 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
var user = { | |
validateCredentials: function (username, password) { | |
return ( | |
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' } | |
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' } | |
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' } | |
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' } | |
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' } | |
: false | |
); |
This file contains hidden or 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
javascript:(function(d,r,i,n){n=d.createElement('div');n.setAttribute('style','position:fixed;width:100%;height:100%;left:0;top:0;opacity:.5;background:#000;z-index:9999');d.body.appendChild(n);n=d.createElement('div');n.setAttribute('style','position:fixed;left:50%;top:50%;width:10ex;height:1.2em;margin:-.5em 0 .5em -5ex;background:#fff;z-index:10000');d.body.appendChild(n);setInterval(function(){n.innerHTML=r[i=(i+1)%r.length];},100);})(document,["(´・ω・`)", "(・ω・` )", "(ω・` )", "(・` )", "(` )", "( )", "( ´)", "( ´・)", "( ´・ω)", "( ´・ω・)"],0); |
This file contains hidden or 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 Image | |
def resize_and_crop(img_path, modified_path, size, crop_type='top'): | |
""" | |
Resize and crop an image to fit the specified size. | |
args: | |
img_path: path for the image to resize. |
This file contains hidden or 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
@mixin optimize-font-size($sizes) { | |
@each $r in $sizes { | |
$w: $safe-for-full * $r * $r; | |
@media (min-width: $w) { | |
font-size: percentage($r); | |
} | |
} | |
} |
This file contains hidden or 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
<p> | |
<a href="http://cloudflare.com/email-protection.html#bcd7c5d3fcd4ddd5d08ec992d2d9c8"> | |
<span id="__cf_email__" class="4c2735230c242d25207e3962222938"> | |
[email protected] | |
</span> | |
<script type="text/javascript"> | |
/* <![CDATA[ */ | |
(function () { | |
try { | |
var s, a, i, j, r, c, l = document.getElementById("__cf_email__"); |