(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
pragma solidity ^0.5.0; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC20/IERC20.sol"; | |
contract Dice { | |
IERC20 public nativeGameToken; | |
mapping(address => UserBet) private userBets; | |
struct UserBet { |
pragma solidity ^0.5.0; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC20/IERC20.sol"; | |
contract Dice { | |
IERC20 public nativeGameToken; | |
mapping(address => UserBet) private userBets; | |
struct UserBet { |
try { | |
// Set the number of desired winners | |
const NumOfWinners = 10; | |
// Set value to true if you want to allow duplicated users | |
const rules = [{ | |
"key": "allowDuplicatedUsers", | |
"value": false, | |
"message": "Multiple comments per user are not allowed" | |
}]; |
echo 'Formatting the code base...' | |
godep go fmt $(go list ./... | grep -v /vendor/) | |
echo 'Optimizing the imports...' | |
goimports -w $(go list -f {{.Dir}} ./... | grep -v /vendor/) | |
echo 'Installing dependencies. This might take some time...' | |
godep go install $(go list ./... | grep -v /vendor/) | |
echo "Executing test" |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
# using such a setup requires `apt-get install lua-nginx-redis` under Ubuntu Trusty | |
# more info @ http://wiki.nginx.org/HttpLuaModule#access_by_lua | |
http { | |
lua_package_path "/etc/nginx/include.d/?.lua;;"; | |
lua_socket_pool_size 100; | |
lua_socket_connect_timeout 10ms; | |
lua_socket_read_timeout 10ms; | |
server { |
package safebuffer | |
import ( | |
"bytes" | |
"sync" | |
) | |
// Buffer is a goroutine safe bytes.Buffer | |
type Buffer struct { | |
buffer bytes.Buffer |
## Install with PHP 7.1 | |
``` | |
sudo add-apt-repository ppa:ondrej/php | |
sudo apt-get update | |
sudo apt-get install libapache2-mod-php7.1 | |
sudo a2dismod php5 | |
sudo a2enmod php7.1 | |
sudo apt-get install php7.1-dom php7.1-mbstring php7.1-zip php7.1-gd php7.1-xml php7.1-gmp php7.1-mysql php7.1-sqlite php7.1-mcrypt php7.1-curl | |
``` |
I hereby claim:
To claim this, I am signing this object:
-- Good reference : http://big-elephants.com/2013-09/exploring-query-locks-in-postgres/ | |
-- show running queries (pre 9.2) | |
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(query_start, clock_timestamp()), usename, query |