Skip to content

Instantly share code, notes, and snippets.

View nulltask's full-sized avatar

Seiya KONNO nulltask

View GitHub Profile
@rummelonp
rummelonp / mozjpeg_install.sh
Created March 7, 2014 15:53
mozjpeg を自前でコンパイルした上で homebrew 管理下に置く
brew install autoconf
brew install automake
brew install libtool
brew install nasm
brew install apple-gcc42
cd /usr/local/src/
git clone git@github.com:mozilla/mozjpeg.git
cd mozjpeg/
git checkout v1.0
@japboy
japboy / Gruntfile.coffee
Created May 16, 2014 15:57
Grunt task to generate sprite sheets using Spritesheet.js for PIXI.js
module.exports = (grunt) ->
grunt.initConfig
sprite:
common:
files:
'assets/img': 'assets/img/common/*.*'
options:
name: 'common'
/**
* Module dependencies.
*/
var exec = require('child_process').exec;
var images = [
'bowl.jpeg'
, 'case.jpeg'
var express = require('express')
, app = express.createApplication();
app.get('/', function(req){
req.render('index').replace('#content');
});
app.get('/list', function(req){
req.render('todo/list', { items: items })
.replace('#content');
/* css only preload */
.foobar:after{
content: '';
width:0;
height:0;
position:absolute;
left:-9999px;
background:url(../images_v2/arrows/up.png);
}
app.dynamicHelpers({
scripts: function(){
return [];
}
});
app.dynamicHelper({
path: function(req){
return req.route.path;
}
});
@mala
mala / jq_quickpatch.html
Created June 26, 2011 03:13 — forked from anonymous/jq_quickpatch.html
quick patch for jQuery selector XSS
<script type="text/javascript">
// http://ma.la/jquery_xss/
(function($){
var _init = $.fn.init;
$.fn.init = function(selector, context, rootjQuery){
// note: only block "#<img>", "a[href=<img onerror=...>]" still work.
if( typeof arguments[ 0 ] == "string" && /^#.*</.test( arguments[ 0 ] ) ){
throw new Error( "selector error" );
}
// console.log(arguments[0]);
@youpy
youpy / amenizer.rb
Created October 31, 2011 19:01
amenizer
%w!ubygems scissor/echonest pit open-uri tempfile!.each {|g| require g }
Scissor.logger.level = Logger::DEBUG
Scissor.echonest_api_key = Pit.get('echonest.com', :require => {
'api_key' => 'your Echo Nest API key'
})['api_key']
infile, outfile = ARGV
file = Tempfile.new(%w/amen .wav/)