Skip to content

Instantly share code, notes, and snippets.

View gluk64's full-sized avatar

Alex G gluk64

  • Matter Labs
View GitHub Profile
@gluk64
gluk64 / contracts.diff
Created July 2, 2020 13:36
contracts.diff
diff --git a/contracts/contracts/Config.sol b/contracts/contracts/Config.sol
index 6fdba645..cc3c77c6 100644
--- a/contracts/contracts/Config.sol
+++ b/contracts/contracts/Config.sol
@@ -44,7 +44,9 @@ contract Config {
uint256 constant BLOCK_PERIOD = 15 seconds;
/// @notice ETH blocks verification expectation
- uint256 constant EXPECT_VERIFICATION_IN = 3 hours / BLOCK_PERIOD;
+ /// Blocks can be reverted if they are not verified for at least EXPECT_VERIFICATION_IN.
@gluk64
gluk64 / example.html
Created November 13, 2019 12:21 — forked from evansims/example.html
Embedding or sharing a image or photo uploaded to Google Drive.
<a href="https://drive.google.com/uc?export=view&id=XXX"><img src="https://drive.google.com/uc?export=view&id=XXX" style="width: 500px; max-width: 100%; height: auto" title="Click for the larger version." /></a>
@gluk64
gluk64 / chainweaver-share.pact
Created November 8, 2019 11:12
Pact shared with chainweaver.
;;
;; "Hello, world!" smart contract/module
;;
;; To try it out, click "Load into REPL" and type into the repl:
;; (hello-world.set-message "universe")
;; (hello-world.greet)
;;
;; Check lines 21 and 34 to play with Formal Verification
;;
@gluk64
gluk64 / chainweaver-share.pact
Created November 8, 2019 11:12
Pact shared with chainweaver.
;;
;; "Hello, world!" smart contract/module
;;
;; To try it out, click "Load into REPL" and type into the repl:
;; (hello-world.set-message "universe")
;; (hello-world.greet)
;;
;; Check lines 21 and 34 to play with Formal Verification
;;
// This is universal, works with Infura -- set provider accordingly
const ethers = require('ethers')
//const provider = ethers.getDefaultProvider('rinkeby')
const provider = new ethers.providers.JsonRpcProvider(process.env.WEB3_URL)
function hex_to_ascii(str1) {
var hex = str1.toString();
var str = '';
for (var n = 0; n < hex.length; n += 2) {
@gluk64
gluk64 / gist:58111de897effd5c9e3c
Created March 28, 2016 16:32 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@gluk64
gluk64 / _json-logger.md
Created December 11, 2015 09:26 — forked from robinsmidsrod/_json-logger.md
json-logger: A practical script to capture multiline output from e.g. cron jobs into a single logstash JSON event

Can be used in crontab like this:

SHELL=/bin/bash
BASH_ENV=~/.bash_profile
# m h  dom mon dow   command
0    * * * * /home/portfolio/portfolio/bin/session.pl                2> >(json-logger -ep pf_session)                | json-logger -p pf_session
0    2 * * * /home/portfolio/portfolio/bin/purge_deleted_messages.pl 2> >(json-logger -ep pf_purge_deleted_messages) | json-logger -p pf_purge_deleted_messages
0,30 * * * * /home/portfolio/portfolio/bin/expire_page_views.pl      2> >(json-logger -ep pf_expire_page_views)      | json-logger -p pf_expire_page_views

I would suggest you put it in /usr/bin to avoid having to setup your PATH variable.

@gluk64
gluk64 / paulcamper-golang.md
Created December 8, 2015 10:53
Golang Dev At Paulcamper.com

https://paulcamper.com is a growing startup from Berlin dedicated to making sharing of private camper vans easy. We are looking for an experienced backend developer to join our team. The goal is to reimplement the existing marketplace on new scalable technologies from skratch (ReactJS + Golang with microservices-based architecture), improving its design and adding cool new features.

What we expect:

  • 2+ years of programming experience
  • Experience with SQL (ideally Postgres)
  • Ideally experience with Golang
  • Excellent communication skills in English
  • You work result- and solution-oriented. You're used to getting things done on your own, without supervision
  • You know how to write clean, testable, maintainable code (TDD experience is a big plus)