Skip to content

Instantly share code, notes, and snippets.

View tosik's full-sized avatar
🏠
Working from home

Toshiyuki Hirooka tosik

🏠
Working from home
  • Tokyo, Japan
View GitHub Profile
@tosik
tosik / duplicated-bom-detector.rb
Last active July 15, 2017 06:03
Xamarin Studio が BOM を複数つけたりするので、それを探し出すジャンクコード
bom = [0xEF, 0xBB, 0xBF]
double_bom = bom + bom
Dir::glob("#{ARGV[0]}/**/*.cs").each do |path|
f = File.open(path, "rb")
s = f.read
f.close
head = s[0..5].unpack("C*")
if head == double_bom
class A {}
struct B {}

class Main
{
  public static void Foo()
  {
    new A();
    new B();
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <cstring>
#include <string.h>
Shader "tosik/UV-Test"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_MovementX ("Movement X", float) = 1
_MovementY ("Movement Y", float) = 1
}
SubShader
{
@tosik
tosik / gist:29497d706599c75d3550efe1ed84d941
Created October 17, 2016 03:01
ありえないくらいひどく見づらい neuecc を見やすくする bookmarklet
javascript:$('body').css('background', 'white');$('*').not('.csharp >span').css('color', 'black');
multitail -l 'redis-cli monitor' /usr/local/var/mysql/mysql-query.log
@tosik
tosik / gist:933de2e4ccacf112b9b1
Last active February 3, 2016 07:36
Mac 上の MySQL に接続されている mono 製のコネクション数を取得する Ruby。
result = `lsof -iTCP:3306 | grep mono-sgen`
puts "#{result.lines.count} connections"
puts result
defmodule Foo do
def loop do
receive do
{:hello, msg} ->
IO.puts msg
loop
{:world, _} ->
IO.puts "bad"
loop
end
@tosik
tosik / gist:15b4452f2837bddbb5d2
Created September 17, 2014 10:50
docker mysql runner
docker run --name mysql -d sameersbn/mysql:latest
foo = Time.now.to_s #=> "2014-05-14 15:35:01 +0900"
bar = Time.now.to_s #=> "2014-05-14 15:35:32 +0900"
foo == bar #=> false