Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Yuan juntao

View GitHub Profile
View welcome.md

Welcome to Drift!

Drift is an always-already versioned, cloud-backed text editor. You can use it to take notes, and save them in the GitHub cloud.

Your gists are always saved locally, and any changes you make will get pushed to GitHub's servers.

To name a gist, touch its name in the toolbar.

You can use the share button at the top-right to copy a link to one of your gists, or view it on the web in Safari.

View omdb_title.php
<?php
$json_str = file_get_contents("http://www.omdbapi.com/?t=" . urlencode($_REQUEST["text"]) . "&y=&plot=short&r=json");
$json = json_decode($json_str, true);
echo "'" . $json['Title'] . "' " . $json['Year'] . ". Rating:" . $json['imdbRating'] . " IMDB: http://www.imdb.com/title/" . $json['imdbID'] . "/ Plot: " . $json['Plot'];
?>
View omdb_search.php
<?php
if ($_REQUEST["user_name"] == "slackbot") {
exit;
}
$cache_file = $_REQUEST["token"] . '.txt';
if (!file_exists($cache_file)) {
// This is a new conversation. Start with search
$json_str = file_get_contents("http://www.omdbapi.com/?s=" . urlencode($_REQUEST["text"]) . "&r=json");
View Corporations_vs_Networks.txt
Most successful unicorn tech startup corporations. All shares are illiquid, and valuation is probably in a bubble.
| Founded | Capital required | Valuation at 2017/8 |
Uber | 2009 | $11.5B | $70B |
Airbnb | 2008 | $3.5B | $31B |
Palantir | 2003 | $2.5B | $20B |
WeWork | 2010 | $8.85B | $21B |
SpaceX | 2002 | $1.5B | $12B |
Pinterest | 2009 | $1.5B | $12B |
Dropbox | 2007 | $0.6B | $10B |
View Deployment
> bytecode="608060405234801561001057600080fd5b506101f0806100206000396000f300608060405260043610610041576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631003e2d214610046575b600080fd5b34801561005257600080fd5b50610071600480360381019080803590602001909291905050506100ec565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820d805160018360200d6101000a0d1916815260200191505b509250505060405180910390f35b60608060405160206040519081016040526001905260206040519081016040527f0900000000000000000000000000000000000000000000000000000000000000905260206040519081016040526001905260206040519081016040527f04000000000000000000000000000000000000000000000000000000000000009052602060405190810160405280600090528460206040519081016040525280604051819003602090039052907f6164640000000000000000000000000000000000000000000000000000000000f59050809150509190505600a165627a7a72305820287012d49379416e8186fadd
View Deployment
var sortloopsABI = [{"constant":true,"inputs":[{"name":"x","type":"uint256"}],"name":"sort","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"pure","type":"function"}];
var sortloopsBC = '0x608060405234801561001057600080fd5b506101f0806100206000396000f300608060405260043610610041576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063fe91386514610046575b600080fd5b34801561005257600080fd5b50610071600480360381019080803590602001909291905050506100ec565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b1578082015181840152602081019050610096565b50505050905090810190601f1680156100de5780820d805160018360200d6101000a0d1916815260200191505b509250505060405180910390f35b60608060405160206040519081016040526001905260206040519081016040527f0900000000000000000000000000000000000000000000000000000000000000905260206040519081016040526001905260206040519081016040527f04000000000000000000000000000000000000000000000000000000000000009052602060405190810
@juntao
juntao / Commands
Created Sep 3, 2018
EVM Performance Test
View Commands
loops.echo(10)
loops.add(2000000)
loops.mul(1000000)
loops.sort(6000)
@juntao
juntao / Command
Created Sep 3, 2018
CVM Performance Test: Addition
View Command
addloops.add(2000000)
@juntao
juntao / Command
Created Sep 3, 2018
CVM Performance Test: Multiplication
View Command
mulloops.mul(1000000)