Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Yiyi Wang shd101wyy

🏠
Working from home
  • Mars, Solar system, Universe
View GitHub Profile
View bind9-clang-tsan.md

clang with -fsanitize=thread flag.

➜  bind9 git:(test-tsan) ✗ make unit
sh /home/yiyiwang/GitHub/bind9/unit/unittest.sh
S:unit:Thu Sep 20 11:21:54 CDT 2018
T:unit:1:A
I: unit tests (using atf-run)
Tests root: /home/yiyiwang/GitHub/bind9
View resolve.js
const url = require("url");
const BASE = "https://staging.iele.dev-mantis.iohkdev.io";
function resolveApiUrl(relativeUrl) {
if (location.hostname.match(/localhost|127\.0\.0\.1/)) {
return url.resolve(BASE, relativeUrl);
} else {
return relativeUrl;
}
}
@shd101wyy
shd101wyy / test.md
Last active Jun 15, 2018
IELE communication
View test.md
  • iele_sendTransaction and iele_call:
➜  mantis-1.0-daedalus-rc1 curl -XPOST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0", "method":"personal_unlockAccount", "params": ["654510a4a13393d9aed326c86bc84df2d5fcfbbf", "4rfv5tgB"], "id": 4}' localhost:8546
{"jsonrpc":"2.0","result":true,"id":4}%                                                                                                                                                                     

➜  mantis-1.0-daedalus-rc1 curl -XPOST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0", "method":"iele_sendTransaction", "params": [{"from":"654510a4a13393d9aed326c86bc84df2d5fcfbbf", "gasPrice":5000000000, "gasLimit": 1000000, "contractCode": "0x0000004C6303690009666163746F7269616C6800010001618001100042650003026101036600006180011200446500020466000102001B610101030040640000660002F6000103660003FE6700000000", "arguments": []}], "id": 3}' localhost:8546
{"jsonrpc":"2.0","result":"0xb696754c82cc75b2d361b5180fc7f86846c1d54d48c907
View README.md

ribbit

I hope we didn't unleash a beast.

A decentralized social media web application based on Ethereum platform.
基于以太坊的去中心化社交程序。

@shd101wyy
shd101wyy / call_another_contract.sol
Created Apr 25, 2018
Ribbit project experiments ground
View call_another_contract.sol
// this file is an example of calling other contracts
pragma solidity ^0.4.0;
contract Test {
mapping (string => uint) data;
address public previousContractAddress;
Test previousContract;
constructor(address previousContractAddress_) public {
@shd101wyy
shd101wyy / hex.js
Last active Apr 19, 2018
string to hex, hex to string
View hex.js
// https://stackoverflow.com/questions/21647928/javascript-unicode-string-to-hex?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
String.prototype.hexDecode = function(){
var j;
var hexes = this.match(/.{1,4}/g) || [];
var back = "";
for(j = 0; j<hexes.length; j++) {
back += String.fromCharCode(parseInt(hexes[j], 16));
}
View gua.sol
pragma solidity ^0.4.0;
// pragma experimental ABIEncoderV2;
// https://medium.com/daox/three-methods-to-transfer-funds-in-ethereum-by-means-of-solidity-5719944ed6e9
contract Gua {
address owner;
address public previousContractAddress;
/**
* 0x0 => earnings
* 0x1 => likes
@shd101wyy
shd101wyy / decent.sol
Last active Apr 16, 2018
My solidity smart contract.
View decent.sol
pragma solidity ^0.4.0;
// pragma experimental ABIEncoderV2;
// https://medium.com/daox/three-methods-to-transfer-funds-in-ethereum-by-means-of-solidity-5719944ed6e9
contract Decent {
mapping (bytes32 => mapping(bytes1 => uint256)) state;
mapping (address => bytes32) previousArticleTransactionHashMap;
mapping (bytes32 => bytes32) previousCommentTransactionHashMap;
mapping (bytes32 => bytes32) previousTagTransactionHashMap;
address owner;
View markdown-tree.js
const fs = require('fs'),
path = require('path')
function spaceAhead(n) {
let outputString = ''
for (let i = 0; i < n; i++) {
outputString += ' '
}
return outputString
}
View calendar-notification.md

Calendar Notification

  1. Visit: https://calendar.google.com, click the arrow on the right side of RV Shared Calendar then choose Calendar settings.

Screen Shot 2017-11-24 at 10.27.57 AM

  1. Choose Edit notifications section, then you can enable the nofication that you like, like Daily agenda. Click Save to save the changes.

Screen Shot 2017-11-24 at 10.28.08 AM