This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I contributed to the Semaphore Trusted Setup Multi-Party Ceremony. | |
The following are my contribution signatures: | |
Circuit: semaphore16 | |
Contributor # 239 | |
Hash: ba38919e cd347495 caa47650 8bef4f56 | |
6f479a56 48413429 cded54ba 96345e16 | |
114aa434 741998d6 00fbae5c a70e5abd | |
1f5638ec 0de88ac0 e7fcf18f 9341e21c | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('ENCRYPTION_KEY', 'EncryptDecryptPHP201908Y'); | |
// Encrypt | |
function encrypt($plaintext) { | |
$ivlen = openssl_cipher_iv_length($cipher = "AES-128-CBC"); | |
$iv = openssl_random_pseudo_bytes($ivlen); | |
$ciphertext_raw = openssl_encrypt($plaintext, $cipher, ENCRYPTION_KEY, $options = OPENSSL_RAW_DATA, $iv); | |
$hmac = hash_hmac('sha256', $ciphertext_raw, ENCRYPTION_KEY, $as_binary = true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'elasticsearch/rails/tasks/import' | |
namespace :elasticsearch do | |
desc 'Rebuild index with zerodown time' | |
task rebuild: :environment do | |
size = (ENV['size'].presence || 1000).to_i | |
model = ENV['model'].to_s.classify.constantize | |
delete_old_index = ENV['delete'].present? | |
es = model.__elasticsearch__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function proxy() { | |
proxy_on | |
$@ | |
proxy_off | |
} | |
function proxy_on() { | |
export all_proxy="http://127.0.0.1:1087" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Faker | |
class PhoneNumber < Base | |
class << self | |
def cell_phone | |
operators = [ | |
134, 135, 136, 137, 138, 139, 147, 150, 151, 152, 157, 158, 159, 182, 187, 188, # china mobile | |
130, 131, 132, 145, 155, 156, 185, 186, 145, # china unicom | |
133, 153, 180, 181, 189 # china telecom | |
] | |
suffix = Random.rand(10000000...99999999) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
if (count($argv) == 1) { | |
throw new InvalidArgumentException('Missing tables'); | |
} | |
$tables = array_slice($argv, 1); | |
$db = new PDO('mysql:dbname=uniqueway_development;host=127.0.0.1;charset=utf8mb4', 'root', ''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git branch --merged=develop | grep -v 'master' | grep -v 'develop' | tr -d '^ ' | xargs git branch -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/^(170[059]\d{7}|(14[57]|15[^4,\D]|17[678])\d{8}|1[38]\d{9})$/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deb http://ftp.sjtu.edu.cn/ubuntu/ trusty main restricted universe multiverse | |
deb http://ftp.sjtu.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse | |
deb http://ftp.sjtu.edu.cn/ubuntu/ trusty-security main restricted universe multiverse | |
deb-src http://ftp.sjtu.edu.cn/ubuntu/ trusty main restricted universe multiverse | |
deb-src http://ftp.sjtu.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse | |
deb-src http://ftp.sjtu.edu.cn/ubuntu/ trusty-security main restricted universe multiverse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
require 'simple_html_dom.php'; // http://sourceforge.net/projects/simplehtmldom/ | |
if (empty($argv[1])) { | |
echo 'Give me download url please.', PHP_EOL; | |
exit; | |
} |
NewerOlder