Skip to content

Instantly share code, notes, and snippets.

View andreyors's full-sized avatar
🎯
Focusing

Andrey O andreyors

🎯
Focusing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am andreyors on github.
  • I am andreyors (https://keybase.io/andreyors) on keybase.
  • I have a public key ASAKfort_WfLWFz9htV-JxKL-SQV3gHVuJhSxrBgnK7sJwo

To claim this, I am signing this object:

#!/bin/bash
docker-compose config --services | xargs -I {} sudo update-hosts update {} $(dinghy ip) > /dev/null
#!/bin/bash
HOSTSFILE="/etc/hosts"
BAKFILE="$HOSTSFILE.bak"
DOMAINREGEX="^[a-zA-Z0-9]{1}[a-zA-Z0-9\.\-]+$"
IPREGEX="^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$"
URLREGEX="^https?:\/\/[a-zA-Z0-9]{1}[a-zA-Z0-9\/\.\-]+$"
backup()
{
function binPrefix() {
if [ -f vendor/bin/$1 ]; then
vendor/bin/$@
else
if [ -f bin/$1 ]; then
bin/$@
else
$@
fi
fi
@andreyors
andreyors / composer
Last active February 25, 2017 15:11
#!/bin/sh
php_no_xdebug() {
temporaryPath="$(mktemp -t php-no-debug)"
env php --ini | grep -o -e "/\([/A-Za-z0-9._-]\+\)\+\.ini" | grep -v xdebug | xargs cat > "$temporaryPath"
env php -n -c "$temporaryPath" "$@"
rm -f "$temporaryPath"
}
[user]
#name = "Max Mustermann"
#email = max.mustermann@test.de
#signingkey = <key>
[commit]
gpgsign = true
[color]
ui = auto
diff = auto
status = auto
@andreyors
andreyors / benchmark.go
Created August 14, 2016 20:06 — forked from everbeen/benchmark.go
BSON vs. Gob vs. MessagePack encoding & decoding benchmark
package main
import (
"bytes"
"encoding/gob"
"fmt"
"github.com/ugorji/go/codec"
"io/ioutil"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
CREATE TABLE payment_rates (
id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
date_from DATE,
date_to DATE,
amount DECIMAL(10, 2),
PRIMARY KEY (id)
) ENGINE=InnoDB;
INSERT INTO payment_rates
(date_from, date_to, amount)
@andreyors
andreyors / server.md
Created September 28, 2015 23:19 — forked from jtadeulopes/server.md
Server setup with ubuntu, nginx and puma for rails app.

Update and upgrade the system

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get autoremove
sudo reboot