View my.json
{
"description": "mirror commands",
"manipulators": [
{ "from": { "key_code": "slash", "modifiers": { "mandatory": [ "right_command" ] } },
"to": [ { "key_code": "z", "modifiers": [ "command" ] } ], "type": "basic" },
{ "from": { "key_code": "slash", "modifiers": { "mandatory": [ "right_command", "right_shift"] } },
"to": [ { "key_code": "z", "modifiers": [ "command", "shift" ] } ], "type": "basic" },
{ "from": { "key_code": "period", "modifiers": { "mandatory": [ "right_command" ] } },
"to": [ { "key_code": "x", "modifiers": [ "command" ] } ], "type": "basic" },
{ "from": { "key_code": "comma", "modifiers": { "mandatory": [ "right_command" ] } },
View UVScroll
Shader "Custom/UVScroll" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Velocity ("Velocity", Range(0, 100)) = 0
_Rotation ("Rotation", Range(0, 360)) = 0
}
SubShader {
Tags { "RenderType"="Opaque" }
CGPROGRAM
View roman
T=[%w(I V X),%w(X L C),%w(C D M), %w(M - -)]
D=[[],[0],[0,0],[0,0,0],[0,1],[1],[1,0],[1,0,0],[1,0,0,0],[0,2]]
(1..1999).each{|n|
s = n.to_s.split('').map{|v|v.to_i}
s.size.times{|i| D[s[i]].each{|j| print T[s.size-i-1][j] } }
puts
}
View jquery.cors.js
$.ajaxTransport("+*", function( options, originalOptions, jqXHR ) {
if(jQuery.browser.msie && window.XDomainRequest) {
var xdr;
return {
send: function( headers, completeCallback ) {
View gist:1200004
[alias]
co = checkout
st = status
ll = log --graph --decorate --oneline
la = log --graph --decorate --oneline --all
[color]
ui = true
View alert.sh
#!/bin/bash
# usage:
# alert.sh [command]
$@
ruby <<EOD
require 'real_growl'
RealGrowl::Application.new("Alert").notify(:title=>"Alert", :description=>"finished: $@", :priority=>0, :sticky => false)
EOD
View convert_asset_to_inline.rb
require 'open-uri'
require 'image_size'
class ConvertAssetInline
def initialize
@orig = nil
@cache = {}
end
def convert(url)