Skip to content

Instantly share code, notes, and snippets.

View lgs's full-sized avatar

Luca G. Soave lgs

View GitHub Profile
@lgs
lgs / reddit.html
Created March 22, 2017 22:16 — forked from sente/reddit.html
An example of a retrieving data from reddit's JSON(p) api using jquery
<!DOCTYPE html>
<!--
Stuart Powers
http://sente.cc/
http://twitter.com/stuartpowers
-->
<html>
<head>
[
{
"_id": "58bc24b6dc064fda8ce841ef",
"index": 0,
"guid": "6dd91d19-108b-4da3-adaf-927b36b666d1",
"isActive": false,
"balance": "$2,519.80",
"picture": "http://placehold.it/32x32",
"age": 40,
"eyeColor": "brown",
# --------------------------------------------------------------
# script to create a new Docker Swarm from scratch on VirtualBox
# --------------------------------------------------------------
#!/usr/bin/bash
NUM_NODES=5
LEADER_NODE=node-1
# clean up
for NODE in $(seq 1 $NUM_NODES); do
# --------------------------------------------------------------
# script to create a new Docker Swarm from scratch on VirtualBox
# --------------------------------------------------------------
#!/usr/bin/bash
NUM_NODES=5
LEADER_NODE=node-1
# clean up
for NODE in $(seq 1 $NUM_NODES); do
@lgs
lgs / create_swarm_cluster.sh
Created February 8, 2017 19:21 — forked from alexei-led/create_swarm_cluster.sh
Deploy Docker Compose (v3) to Swarm (mode) Cluster
#!/bin/bash
# vars
[ -z "$NUM_WORKERS" ] && NUM_WORKERS=3
# init swarm (need for service command); if not created
docker node ls 2> /dev/null | grep "Leader"
if [ $? -ne 0 ]; then
docker swarm init > /dev/null 2>&1
fi
git clone https://github.com/vfarcic/go-demo.git
cd go-demo
docker-machine create -d virtualbox go-demo
docker-machine env go-demo
eval $(docker-machine env go-demo)
@lgs
lgs / startSwarm.sh
Created February 5, 2017 22:07 — forked from byrnedo/startSwarm.sh
Start 3 Machine Local Docker Swarm
#!/bin/bash
set -euo pipefail
function useDockerEnv {
eval "$(docker-machine env $1)"
}
function getIfaceIP {
local machine="$1"
@lgs
lgs / youtube api video category id list
Created January 6, 2017 20:06 — forked from dgp/youtube api video category id list
youtube api video category id list
2 - Autos & Vehicles
1 - Film & Animation
10 - Music
15 - Pets & Animals
17 - Sports
18 - Short Movies
19 - Travel & Events
20 - Gaming
21 - Videoblogging
22 - People & Blogs
@lgs
lgs / price.md
Created December 14, 2016 22:12 — forked from justjanne/Price Breakdown.md
AWS Lightsail vs DigitalOcean, VULTR and Linode

Price breakdown vs DigitalOcean, Vultr, Linode, OVH, and Online.net / Scaleway:

$5/mo

Provider RAM Cores Storage Transfer
LightSail 512MB 1 20GB SSD 1TB
DO 512MB 1 20GB SSD 1TB
@lgs
lgs / grunt-hugo-lunrjs.md
Created November 12, 2016 12:15 — forked from sebz/grunt-hugo-lunrjs.md
hugo + gruntjs + lunrjs = <3 search