Assuming that projects are organized like this ~/workspace[/<group>[/<vendor>]]/<project>.
Project acme/api is written in Go. It will open atom with all projects and env set for acme/api.
project acme/{api,web} todo| Verifying my Blockstack ID is secured with the address 1Q8pg93Nu7XCnu5svsXfzRHhSZjDY4cHsm https://explorer.blockstack.org/address/1Q8pg93Nu7XCnu5svsXfzRHhSZjDY4cHsm |
| os = require('os') | |
| window.setInterval (-> | |
| free = Math.round((os.freemem() / os.totalmem()) * 100) | |
| console.log 'Free memory: ' + free + ' %' | |
| if free <= 5 | |
| atom.reload() | |
| return | |
| ), 60 * 1000 |
Assuming that projects are organized like this ~/workspace[/<group>[/<vendor>]]/<project>.
Project acme/api is written in Go. It will open atom with all projects and env set for acme/api.
project acme/{api,web} todo| #!/bin/sh | |
| set -eu | |
| readonly psqlOptions="-h postgres postgres postgres" | |
| initdb () { | |
| psql $psqlOptions -q -c "CREATE TABLE IF NOT EXISTS __version (id integer PRIMARY KEY, value varchar(255));" | |
| psql $psqlOptions -q -c "INSERT INTO __version VALUES (1, '') ON CONFLICT DO NOTHING" | |
| } |
| # docker build && docker run | |
| dbr () { | |
| id=$(docker build . | grep 'Successfully built' | cut -d' ' -f 3) | |
| if [ $? -ne 0 ]; then | |
| exit 1; | |
| fi | |
| docker run "$id" "${@}" | |
| } |
| #!/bin/bash | |
| dir=$(mktemp -d) | |
| old=$1 | |
| new=$2 | |
| git clone "$old" "$dir" | |
| cd "$dir" | |
| git remote add new "$new" | |
| git push -u new master |
| FROM php:5.6-apache | |
| ENV ADMINER_VERSION=4.2.2 | |
| RUN apt-get update && apt-get install -y \ | |
| libpq-dev \ | |
| && docker-php-ext-install pgsql | |
| RUN curl -LSs https://www.adminer.org/static/download/$ADMINER_VERSION/adminer-$ADMINER_VERSION.php > /var/www/html/index.php \ | |
| && rm /var/www/html/index.html |
| var x = /* elastic mapping */ {}; | |
| var mappings = x.storage.mappings; | |
| var map = {}; | |
| for (var i in mappings) { | |
| var k = Object.keys(mappings[i].properties); | |
| for (l = 0; l < k.length; l++) { | |
| map[k[l]] = {}; | |
| } | |
| } | |
| for (var i in mappings) { |
| #!/usr/bin/env php | |
| <?php | |
| require __DIR__ . '/vendor/autoload.php'; | |
| echo (new Latte\Engine) | |
| ->setLoader(new Latte\Loaders\StringLoader) | |
| ->compile(file_get_contents('php://stdin')); |
| location ~ /(?<namespace>[a-z][a-z0-9]*)/(?<package>[a-z][a-z0-9]*) { | |
| if ($args = "go-get=1") { | |
| add_header Content-Type text/html; | |
| return 200 '<meta name="go-import" content="$host/$namespace/$package git https://git.$host/$namespace/$package">'; | |
| } | |
| } |