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
require 'rake' | |
require 'css_splitter' | |
desc 'split css files' | |
namespace :css do | |
task :split do | |
infile = ENV['infile'] || raise("missing infile") | |
outdir = ENV['outdir'] || File.dirname(infile) | |
max_selectors = ENV['max_selectors'] || 4095 |
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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use utf8; | |
use 5.010000; | |
use AE; | |
use AnyEvent::HTTP; | |
my @urls = ( |
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
// jQuery MobileのloadPageで異なるホストを弾く | |
// Note: 同一ドメインにオープンリダイレクタがないか確認すること | |
(function($){ | |
var old = $.mobile.loadPage; | |
var gethost = function(url){ | |
var a = document.createElement("a"); | |
a.href = url; | |
return a.host | |
}; |
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
// jQueryでクロスドメイン読み込みを全般的に禁止する | |
// Note: 同一ドメインにオープンリダイレクタがないか確認すること | |
(function($){ | |
var gethost = function(url){ | |
var a = document.createElement("a"); | |
a.href = url; | |
return a.host | |
}; | |
var old_beforesend = $.ajaxSettings.beforeSend; |
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
# FurlX::ParanoidAgent 的なやつ | |
my $furl = Furl->new( | |
inet_aton => \&_inet_aton, | |
); | |
sub _inet_aton { | |
my $addr = Net::DNS::Lite::inet_aton(@_); | |
if (is_local_addr($addr)) { return } | |
$addr; |
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
<script type="text/javascript"> | |
// http://ma.la/jquery_xss/ | |
var _$=$; | |
$=function(){ | |
if( typeof arguments[ 0 ] == "string" && /^#.*</.test( arguments[ 0 ] ) ){ | |
throw new Error( "selector error" ); | |
} | |
return _$.apply( this, arguments ); | |
}; | |
</script> |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use DBIx::Sunny; | |
use Digest::MurmurHash qw/murmur_hash/; | |
use Text::ASCIITable; | |
use String::Random qw/random_regex/; | |
my $dbh = DBIx::Sunny->connect('dbi:mysql:test'); |
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
#!/usr/bin/env macruby | |
# | |
# MacRubyで画面グリッチをフルスクリーン表示する | |
# | |
# http://twitter.com/negipo/status/67572370247913473 | |
# | |
# ## Usage | |
# | |
# ./glitch.rb | |
# |
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 | |
use strict; | |
use warnings; | |
use Getopt::Long; | |
use Test::Httpd::Apache2; | |
use Path::Class; | |
my $port = 5000; | |
my $root = '.'; |
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
/* Copyright 2011 by Yasuhiro Matsumoto | |
* modification, are permitted provided that the following conditions are met: | |
* | |
* 1. Redistributions of source code must retain the above copyright notice, | |
* this list of conditions and the following disclaimer. | |
* 2. Redistributions in binary form must reproduce the above copyright notice, | |
* this list of conditions and the following disclaimer in the documentation | |
* and/or other materials provided with the distribution. | |
* | |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |