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
var express = require('express'); | |
var http = require('http'); | |
var path = require('path'); | |
var fs = require("fs"); | |
var jade = require("jade"); | |
var app = express(); | |
app.set('port', process.env.PORT || 3000); | |
app.set('views', path.join(__dirname, 'views')); | |
app.set('view engine', 'jade'); |
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
mixin func1(id, content) | |
.col | |
p= content | |
a(href="/view/#{id}") Click to Read More | |
p Test | |
i Indentation | |
b is Cool | |
i But not that cool | |
b Can slow down execution | |
i oh for real? |
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
function fibonacci(n) { | |
if (n < 2) | |
return 1; | |
else | |
return fibonacci(n-2) + fibonacci(n-1); | |
} | |
fibonacci(40); |
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 | |
$host = "localhost"; | |
$username = "root"; | |
$password = "123"; | |
$db_name = "test"; | |
$db=mysql_connect($host, $username, $password) or die('Could not connect'); | |
mysql_select_db($db_name, $db) or die('no db'); | |
$sth = mysql_query("SELECT * FROM sample s"); | |
$rows = array(); |
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
function perform() { | |
console.log("Finding button") | |
$($("._4xev")[1]).click(); | |
setTimeout(function() { | |
$(".uiContextualLayer").each(function() { | |
var b = $(this).is(':visible'); | |
if (b) { | |
var t = $(this).find("._54nh"); | |
var a = {}; | |
t.each(function() { |
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
version: '2' | |
services: | |
redis: | |
image: redis:3 | |
mongo: | |
image: mongo:2.6 | |
restart: always | |
volumes: | |
- "./data/mongo:/data/db" |
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
# Create Key Store Node | |
docker-machine create -d virtualbox mh-keystore-vb | |
docker $(docker-machine config mh-keystore-vb) run -d \ | |
-p "8500:8500" \ | |
-h "consul" \ | |
progrium/consul -server -bootstrap | |
# Create Primary Node | |
docker-machine create \ | |
-d virtualbox \ |
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
$ eval $(docker-machine env --swarm mhs-demo0-vb) | |
$ docker info | |
Containers: 60 | |
Images: 7 | |
Role: primary | |
Strategy: spread | |
Filters: health, port, dependency, affinity, constraint | |
Nodes: 2 | |
mhs-demo0-vb: 192.168.99.101:2376 | |
└ Containers: 16 |
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
$ eval $(docker-machine env --swarm mhs-demo0-do) | |
$ docker info | |
Containers: 3 | |
Images: 2 | |
Role: primary | |
Strategy: spread | |
Filters: health, port, dependency, affinity, constraint | |
Nodes: 2 | |
mhs-demo0-do: 188.166.113.176:2376 | |
└ Containers: 2 |
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
docker run --name iperf_host -d -ti --net host \ | |
--env="constraint:node==mhs-demo0-do" \ | |
mustafaakin/alpine-iperf iperf -s | |
# Wait a little | |
sleep 1 | |
for run in {1..5}; do | |
docker run --net host --env="constraint:node==mhs-demo1-do" -ti \ | |
mustafaakin/alpine-iperf \ |
OlderNewer