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
pong_c = None | |
ping_c = None | |
def ping(): | |
i = 0 | |
while True: | |
res = yield | |
print(res) | |
i += 1 | |
pong_c.send("ping") |
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
var filter = eth.filter({fromBlock:0, toBlock:'latest', address: "0x.."}); | |
filter.get(function (err, transactions) { | |
transactions.forEach(function (tx) { | |
var txInfo = eth.getTransactionReceipt(tx.transactionHash); | |
/* Here you have | |
txInfo.contractAddress; | |
txInfo.from; | |
txInfo.input; | |
*/ | |
}); |
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
pragma solidity ^0.4.0; | |
contract Coin { | |
address public minter; | |
mapping(address => uint) public ballances; | |
constructor() { | |
minter = msg.sender; | |
} |
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
pragma solidity ^0.4.0; | |
contract Storage { | |
int256 v; | |
constructor (int256 i) { | |
v = i; | |
} | |
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
reduce(lambda acc, x: [*acc, x], range(3,9), [10,11,12]) |
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
package main | |
import ( | |
"fmt" | |
) | |
func runner(tasks []int, workers int, f func(int) int) { | |
in, out := make(chan int), make(chan int) |
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
//https://play.golang.org/p/GWkvlW7O2_q | |
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
w := make(chan int) |
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
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: nginx | |
spec: | |
containers: | |
- name: shell | |
image: centos:7 | |
command: | |
- "bin/bash" |
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
def f(L): | |
if L == []: | |
return [] | |
pivot = L[0] | |
return ( f([x for x in L[1:] if x < pivot]) + [pivot] + f([x for x in L[1:] if x >= pivot]) ) |
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
$PSVersionTable | |
Set-PSDebug -Trace 2 -Strict | |
$ErrorActionPreference = "Stop" | |
$opts = [System.Management.Automation.Remoting.PSSessionOption]::new() | |
$opts.OutputBufferingMode="Drop" | |
$creds = Get-Credentials |