Skip to content

Instantly share code, notes, and snippets.

Avatar

Fan Zhang bl4ck5un

  • New York, USA
View GitHub Profile
@bl4ck5un
bl4ck5un / docker-compose.yml
Created Jan 23, 2020
unblockneteasemusic docker compose
View docker-compose.yml
version: '3'
services:
unblockneteasemusic:
image: nondanee/unblockneteasemusic
environment:
NODE_ENV: production
ports:
- 8080:8080
- 8081:8081
View gist:75005ae8ab2d225a529925044e521954
#include "emp-sh2pc/emp-sh2pc.h"
using namespace emp;
using namespace std;
const string circuit_file_location = macro_xstr(EMP_CIRCUIT_PATH);
int port, party;
string file = circuit_file_location+"/AES-non-expanded.txt";//adder_32bit.txt";
CircuitFile cf(file.c_str());
@bl4ck5un
bl4ck5un / ck.diff
Created Feb 25, 2019
Difference between the old and the new cryptokitties' geneScience smart contract
View ck.diff
diff --git a/old.sol b/new.sol
index 0184107..1419bcd 100644
--- a/old.sol
+++ b/new.sol
@@ -1,16 +1,35 @@
pragma solidity ^0.4.18;
-
+contract KittyCoreInterface {
+ function cooAddress() public returns(address);
@bl4ck5un
bl4ck5un / bitcoin.conf
Last active May 2, 2018
Simple bitcoind config for regtest
View bitcoin.conf
##
## bitcoin.conf configuration file. Lines beginning with # are comments.
##
daemon=1
regtest=1
listen=0
# JSON-RPC options (for controlling a running Bitcoin/bitcoind process)
rpcuser=exch
@bl4ck5un
bl4ck5un / sgx_status.h
Last active May 2, 2018
To fix the missing "sgx_status.h" error in https://shwetasshinde24.github.io/Panoply/
View sgx_status.h
/**
*
* Copyright(c) 2011-2016 Intel Corporation All Rights Reserved.
*
* The source code contained or described herein and all documents related to
* the source code ("Material") are owned by Intel Corporation or its suppliers
* or licensors. Title to the Material remains with Intel Corporation or its
* suppliers and licensors. The Material contains trade secrets and proprietary
* and confidential information of Intel or its suppliers and licensors. The
* Material is protected by worldwide copyright and trade secret laws and treaty
@bl4ck5un
bl4ck5un / sgx_v1.9.0.sh
Created Oct 2, 2017
Install SGX SDK v1.9.0
View sgx_v1.9.0.sh
#!/bin/sh -e
SGX_SDK_BIN=sgx_sdk.bin
wget -O $SGX_SDK_BIN https://download.01.org/intel-sgx/linux-1.9/sgx_linux_ubuntu16.04.1_x64_sdk_1.9.100.39124.bin
chmod a+x $SGX_SDK_BIN
echo -e 'no\n/opt/intel' | sudo ./$SGX_SDK_BIN
echo 'source /opt/intel/sgxsdk/environment' >> ~/.zshrc
@bl4ck5un
bl4ck5un / responsive-semantic-ui.css
Created May 12, 2017
Responsive helpers (mobile-only etc.) for semantic-ui
View responsive-semantic-ui.css
/* Semantic UI has these classes, however they're only applicable to*/
/* grids, containers, rows and columns.*/
/* plus, there isn't any `mobile hidden`, `X hidden` class.*/
/* this snippet is using the same class names and same approach*/
/* plus a bit more but to all elements.*/
/* see https://github.com/Semantic-Org/Semantic-UI/issues/1114*/
/* Mobile */
@media only screen and (max-width: 767px) {
[class*="mobile hidden"],
@bl4ck5un
bl4ck5un / Application.sol
Created Apr 17, 2017
Application Contract for Town Crier
View Application.sol
contract Application {
event Request(int64 requestId, address requester, uint dataLength, bytes32[] data);
event Response(int64 requestId, address requester, uint64 error, uint data);
event Cancel(uint64 requestId, address requester, bool success);
uint constant MIN_GAS = 30000 + 20000;
uint constant GAS_PRICE = 5 * 10 ** 10;
uint constant TC_FEE = MIN_GAS * GAS_PRICE;
uint constant CANCELLATION_FEE = 25000 * GAS_PRICE;
@bl4ck5un
bl4ck5un / ias_test.cpp
Created Dec 30, 2016
contact IAS (Intel Attestation Service) via REST API
View ias_test.cpp
#include "restclient-cpp/connection.h"
#include "restclient-cpp/restclient.h"
#include <iostream>
#include <string>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <stdexcept>
@bl4ck5un
bl4ck5un / ias_test.py
Created Dec 30, 2016
contact IAS via REST API
View ias_test.py
import requests as rq
import httpsig
import json
import pprint
KEY_DIR = '/home/fan/Downloads/att_keys'
cert=(KEY_DIR + '/client.crt', KEY_DIR + '/client.key')
def print_headers(headers):
print 'HEADERS: '
You can’t perform that action at this time.