Skip to content

Instantly share code, notes, and snippets.

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

Hiroyuki Tachibana hiroism007

🏠
Working from home
View GitHub Profile
// SPDX-License-Identifier: GPL-3.0
/*
Copyright 2021 0KIMS association.
This file is generated with [snarkJS](https://github.com/iden3/snarkjs).
snarkJS is a free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
pragma circom 2.0.0;
include "../node_modules/circomlib/circuits/poseidon.circom";
include "./tree.circom";
template CalculateSecret() {
signal input identityNullifier;
signal input identityTrapdoor;
signal output out;
@hiroism007
hiroism007 / Test.sol
Created October 29, 2021 22:57
Test.sol
pragma solidity ^0.5.1;
contract a42LockDev {
// 利用権
struct Entitlement {
uint256 startTime;
uint256 endTime;
}
// アドレスごとの利用権のマッピング
mapping (address => Entitlement) internal entitlements;
// コントラクトの操作を行うアドレス
### Keybase proof
I hereby claim:
* I am hiroism007 on github.
* I am hiroyuki (https://keybase.io/hiroyuki) on keybase.
* I have a public key ASCyf4jlzOAgGsTDBRmP7t_ZPO9s7EnWJz5idy7KJhzqUAo
To claim this, I am signing this object:
@hiroism007
hiroism007 / minecraft.sh
Last active February 6, 2016 09:35
minecraft save data
# セーブデータのあるPC端末
mv /Users/oresama/Library/Application Support/minecraft/saves ~/Dropbox/minecraft/saves
ln -s /Users/oresama/Library/Application Support/minecraft/saves ~/Dropbox/minecraft/saves
# 共有したい端末
rm -rf /Users/oresama2/Library/Application Support/minecraft/saves
ln -s /Users/oresama2/Library/Application Support/minecraft/saves ~/Dropbox/minecraft/saves
@hiroism007
hiroism007 / create_dammies.rb
Last active December 18, 2015 05:29
dammyデータを作るRubyScript
class CreateDammies
require "rubygems"
require "mysql2"
def initialize(host = "localhost", username = "root", password = "", database = "nicomon")
@client = Mysql2::Client.new(host: host, username: username, password: "", database: database)
end
def create_user(numbers)
@hiroism007
hiroism007 / rmgick_ruby.rb
Last active December 17, 2015 21:29
画像ぼかしwith Rmagick
require "rubygems"
require "rmagick"
def directory_search(path)
list = Dir.glob("#{path}/*")
list.each_with_index do |child, index|
if File.directory?(child)
directory_search(child)
else
if File.extname(child) =~ /(jpg)|(png)/
@hiroism007
hiroism007 / matrix.rb
Created May 1, 2013 09:00
マトリックスのOPみたいな感じをコマンドライン上で表現
class String
def colorize(color_code)
"\e[#{color_code}m#{self}\e[0m"
end
def green; colorize(32); end
end
def like_matrix(size=1)
[*0..9,*'a'..'z',*'A'..'Z'].sample(size).join
@hiroism007
hiroism007 / Sort.java
Created April 24, 2013 15:27
選択ソート
public class Sort {
static int[]testNumbers;
public static void main(String[] args) {
testNumbers = new int[10];
for (int i = 0; i < testNumbers.length; i++) testNumbers[i] = (int) (Math.random() * testNumbers.length + 1);
for (int i :testNumbers) System.out.print(i);
@hiroism007
hiroism007 / InsertSort.java
Created April 24, 2013 15:27
挿入ソート
testNumbers = new int[10];