Skip to content

Instantly share code, notes, and snippets.

View mewlist's full-sized avatar

mewlist mewlist

  • Tokyo, Japan
  • 07:17 (UTC +09:00)
  • X @mewlist
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEditor;
using UnityEngine;
namespace Mewlist
{
public class EditorBatchProcessor
{
@mewlist
mewlist / Holo
Created September 26, 2018 18:16
Hologram Shader
Shader "Custom/Holo" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
_Emission ("Emission", Range(0,1)) = 0.0
}
SubShader {
ColorMask 0
@mewlist
mewlist / tut-key-find
Created November 8, 2017 01:41
漢直のキーストロークを探す
#!/usr/bin/ruby
puts ARGV[0] + ": " +
ARGV[0].split(//).map{|c|
open("google-ime_tutc_my.utf.txt").read.split("\n")
.inject({}){|acc, line|
lambda{|v| acc[v.last] = v.first }.call line.split
acc
}[c]
}.join(" ")
@mewlist
mewlist / my.json
Last active October 6, 2017 01:33
my karabiner
{
"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" ] } },
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
@mewlist
mewlist / roman
Created April 25, 2012 12:46
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
}
@mewlist
mewlist / jquery.cors.js
Created January 16, 2012 05:57
Cross-Origin Resource Sharing (CORS) for jQuery for IE8+
$.ajaxTransport("+*", function( options, originalOptions, jqXHR ) {
if(jQuery.browser.msie && window.XDomainRequest) {
var xdr;
return {
send: function( headers, completeCallback ) {
@mewlist
mewlist / gist:1200004
Created September 7, 2011 07:55
My ~/.gitconfig
[alias]
co = checkout
st = status
ll = log --graph --decorate --oneline
la = log --graph --decorate --oneline --all
[color]
ui = true
@mewlist
mewlist / alert.sh
Created May 27, 2011 05:45
Notification of command finished with real-growl.
#!/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
require 'open-uri'
require 'image_size'
class ConvertAssetInline
def initialize
@orig = nil
@cache = {}
end
def convert(url)