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 / 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
multitail -l 'redis-cli monitor' /usr/local/var/mysql/mysql-query.log
@tosik
tosik / gist:29497d706599c75d3550efe1ed84d941
Created October 17, 2016 03:01
ありえないくらいひどく見づらい neuecc を見やすくする bookmarklet
javascript:$('body').css('background', 'white');$('*').not('.csharp >span').css('color', 'black');
Shader "tosik/UV-Test"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_MovementX ("Movement X", float) = 1
_MovementY ("Movement Y", float) = 1
}
SubShader
{
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <cstring>
#include <string.h>
class A {}
struct B {}

class Main
{
  public static void Foo()
  {
    new A();
    new B();
@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
@tosik
tosik / log.sh
Created June 6, 2018 11:34
Boost.Test 実験
$ cat main.cpp
#define BOOST_TEST_MAIN
#include <boost/test/included/unit_test.hpp>
BOOST_AUTO_TEST_CASE(test_foo_1)
{
BOOST_CHECK(true);
}
$ g++ main.cpp
g++ -std=c++11 foo.cpp
foo.cpp:11:63: error: cannot increment value of type 'const std::__1::__wrap_iter<const T *>'
for (const auto & it = foo.begin() ; it != foo.end() ; it ++);
~~ ^
1 error generated.
make: *** [all] Error 1
@tosik
tosik / print-colourxxx.sh
Created July 11, 2018 01:06
Print color by colourXXX
for i in {0..255}; do
printf "\x1b[38;5;${i}mcolour${i}\x1b[0m\n"
done