Bitcoin miners want their newly-found blocks to propagate across the network as quickly as possible, because every millisecond of delay increases the chances that another block, found at about the same time, wins the "block race."
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
<?php | |
// Let's create /tmp/ninja-lock1.txt ... | |
$fp0 = fopen('/tmp/ninja-lock1.txt', 'c'); | |
// ... and close it imiedietly | |
fclose($fp0); | |
// File handler $fp0 was closed so flock() | |
// is unable to use it to gain lock. | |
// It will fail with wouldblock set to 0 | |
// as it doesn't make sense to wait on unusable file handle. |
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
#!/bin/bash | |
# Copyright (c) 2012 Yu-Jie Lin | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of | |
# this software and associated documentation files (the "Software"), to deal in | |
# the Software without restriction, including without limitation the rights to | |
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | |
# of the Software, and to permit persons to whom the Software is furnished to do | |
# so, subject to the following conditions: | |
# |
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
$ /usr/bin/michal_gorski.sh --help | |
"Michał Górski is an ambitious developer who isn't scared by any work. | |
Just provide him with some challenges and watch how magic happens. | |
You will be impressed how quick, creative and thoughtful this person is." | |
Usage: | |
--do-awesome=<work_to_be_done> Do work and provide awesome results | |
--do-crap=<work_to_be_done> Do work and provide crappy results | |
--help Read about the only developer you need |
I hereby claim:
- I am arvenil on github.
- I am arvenil (https://keybase.io/arvenil) on keybase.
- I have a public key whose fingerprint is 6219 08B1 B833 37F3 C040 BB32 9B2A 8BE3 2C07 EA6C
To claim this, I am signing this object:
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 port allows to obtain a free port that is ready to use. | |
package port | |
import ( | |
"net" | |
"emperror.dev/errors" | |
) | |
// New returns a free open port that is ready to use. |
Create data table and partition it by state
CREATE TABLE data (
id bigserial not null,
state smallint not null DEFAULT 1,
updated_at timestamp without time zone default now()
) partition by list(state);
create table data_pending partition of data for values in (1);
create table data_processing partition of data for values in (2);