In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:
- You can separate the code into different repositories.
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), 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(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
# Docker-in-Docker Gitlab runners setup taken from: | |
# https://medium.com/@tonywooster/docker-in-docker-in-gitlab-runners-220caeb708ca | |
dind: | |
restart: always | |
privileged: true | |
volumes: | |
- /var/lib/docker | |
image: docker:17.09.0-ce-dind | |
command: | |
- --storage-driver=overlay2 |
# It is possible to paas sshuttle common ssh options such as UserKnownHostsFile, StrictHostIPChecking, CheckHostIP etc | |
# Normal sshuttle command: | |
sshuttle -r ubuntu@<some-ip>:2222 <remote_subnet(s)/CIDR> | |
# In the above scenario, for most systems, StrictHostKeyChecking, and all other good security features will be in effect. | |
# That's normally a good thing, except when it's not. Like when you have to continually clean a known hosts file because | |
# your testing different build options and the remote host's ECDSA, DSA, RSA <or whatever> keeps changing. | |
# By making use of the -e option you can control how sshuttle uses ssh. Any option your ssh-client supports can be passed. |
Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.
The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows
the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir
and you are good to go.
Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to
a specific version, you will need to compile it yourself. Then asdf
is your best friend.
FROM openjdk:8u181-jre-alpine3.8 | |
ARG version | |
RUN apk add --update libc6-compat && \ | |
rm -rf /var/cache/apk/* | |
RUN mkdir /opt | |
RUN wget -O /tmp/pantheon.tar.gz https://bintray.com/consensys/pegasys-repo/download_file?file_path=pantheon-$version.tar.gz && \ |
_.mixin({ | |
// Get/set the value of a nested property | |
deep: function (obj, key, value) { | |
var keys = key.replace(/\[(["']?)([^\1]+?)\1?\]/g, '.$2').replace(/^\./, '').split('.'), | |
root, | |
i = 0, | |
n = keys.length; |
// # Mocha Guide to Testing | |
// Objective is to explain describe(), it(), and before()/etc hooks | |
// 1. `describe()` is merely for grouping, which you can nest as deep | |
// 2. `it()` is a test case | |
// 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run | |
// before/after first/each it() or describe(). | |
// | |
// Which means, `before()` is run before first it()/describe() |
#!/usr/bin/env python | |
from __future__ import unicode_literals | |
# Original idea: http://dinaburg.org/bitsquatting.html | |
import gevent.monkey | |
gevent.monkey.patch_all() | |
import dns.name, dns.resolver | |
import gevent, gevent.pool | |
import sys |
const fs = require("fs"); | |
const solc = require('solc') | |
let Web3 = require('web3'); | |
let web3 = new Web3(); | |
web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545')); | |
var input = { | |
'strings.sol': fs.readFileSync('strings.sol', 'utf8'), | |
'StringLib.sol': fs.readFileSync('StringLib.sol', 'utf8'), |