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
type list []*item | |
// Work | |
for g := range *list { | |
z := *list | |
println(z[g].Name) | |
} | |
// Fail | |
for g := range *list { |
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 main | |
import ( | |
"github.com/google/jsonapi" | |
"github.com/labstack/echo" | |
"net/http" | |
) | |
type Album struct { | |
ID int `jsonapi:"primary,albums"` |
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
Note that that test[] is squashed | |
$ http --form -f PUT http://127.0.0.1/api/post/ZDqojJqaYumqxJKzXUvB7Y author='author' content='content' title='title' test[]='ffff' test[]='zzzz' file@~/Pictures/Screenshot\ from\ 2015-09-13\ 17-12-02.png | |
HTTP/1.1 200 OK | |
Connection: keep-alive | |
Content-Encoding: gzip | |
Content-Type: text/html; charset=UTF-8 | |
Date: Tue, 09 Feb 2016 19:42:48 GMT | |
Server: nginx/1.9.7 |
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
DROP TABLE test; | |
SELECT * FROM test; | |
CREATE TABLE test ( | |
id SERIAL, | |
name TEXT | |
); | |
INSERT INTO test (name) VALUES ('a'), ('b'), ('c'), ('d'), ('e'), ('f'), ('g'), ('h'); |
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
# Few steps to setup Skype as a docker | |
# Might be over complicated as I did it back at Oct 2014 when I just started with docker (but it still works well) | |
https://registry.hub.docker.com/u/tomparys/skype/ | |
# Create Skype container | |
# Insure .Skype exist in the home dir | |
sudo docker run --name skype -d -p 55555:22 -v /home/miki/.Skype:/home/docker/.Skype tomparys/skype |
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
$this->add(array( | |
'name' => 'name', | |
'options' => [ | |
'label' => 'Garden Name', | |
'attributes' => [ | |
'class' => 'col-lg-2 col-sm-2 control-label', | |
], | |
], | |
'attributes' => [ | |
'class' => 'form-control', |
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
https://registry.hub.docker.com/u/tomparys/skype/ | |
# Create Skype container | |
# Insure .Skype exist in the home dir | |
sudo docker run --name skype -d -p 55555:22 -v /home/miki/.Skype:/home/docker/.Skype tomparys/skype | |
ssh-keygen -t rsa -C "Just for skype" | |
$ cat .ssh/config |
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 | |
/** | |
* Delete an entity from the global identity map and all other queues | |
* @param AbstractDomainEntity $entity | |
*/ | |
static public function unRegister(AbstractDomainEntity $entity) | |
{ | |
$instance = self::getInstance(); | |
$instance->registerClean($entity); | |
unset($instance->all[$instance->globalKey($entity)]); |
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
# Ubuntu 14.04 don't have nsenter - the straight forward way required me to install build tools and etc. | |
# I preferred to keep the system clean and install nsenter in a container and then copy the command to the host | |
# Note - its also possible to run nsenter from a container (didn't tried) https://github.com/jpetazzo/nsenter | |
# start a container | |
docker run --name nsenter -it ubuntu:14.04 bash | |
## in the docker | |
apt-get update | |
apt-get install git build-essential libncurses5-dev libslang2-dev gettext zlib1g-dev libselinux1-dev debhelper lsb-release pkg-config po-debconf autoconf automake autopoint libtool |
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
On host 1 | |
nc -v -l 2222 > /dev/null | |
On host 2 | |
dd if=/dev/zero bs=1024K count=30720 | nc -v 10.0.26.132 2222 |