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
#!/bin/bash | |
# Script para generar entorno simulado de cluster Swarm con 3 nodos | |
# Creación de maquina default (se utilizara como cliente ) | |
# docker-machine create -d virtualbox default | |
eval $(docker-machine env default) | |
# Lanzamos swarm desde maquina default | |
SWARM_TOKEN=$(docker run swarm create) |
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
echo "Fetching tags ..." | |
git fetch newscred --tags | |
VERSION="$(git describe --abbrev=0 --tags)" | |
echo "Latest tag" $VERSION | |
#replace . with space so can split into an array | |
VERSION_BITS=(${VERSION//./ }) | |
#get number parts and increase last one by 1 | |
VNUM1=${VERSION_BITS[0]} | |
VNUM2=${VERSION_BITS[1]} |
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
branch_name="$(git symbolic-ref --short -q HEAD)" | |
echo "Rebasing" $branch_name | |
git fetch newscred master:master && git rebase newscred/master && git push --force origin $branch_name |
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
class AssetViewSet(viewsets.ModelViewSet): | |
queryset = Asset.objects.all() | |
serializer_class = AssetSerializer | |
def list(self, request): | |
parent = self.request.query_params.get('parent', None) | |
assets = self.get_queryset().filter(parent=parent) | |
page = self.paginate_queryset(assets) | |
if page is not None: |
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
import scala.util.parsing.json.JSON | |
val txt = """ | |
{ | |
"name" : "Watership Down", | |
"location" : { | |
"lat" : 51.235685, | |
"long" : -1.309197 | |
}, | |
"residents" : [ { |
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
# File /etc/init/analytics-spark.conf | |
description "Analytics spark" | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
# respawn | |
env AWS_REGION='us-east-1' |
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
curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | bash | |
nvm install 0.11.13 | |
nvm alias default 0.11.13 | |
sudo chown -R `whoami` ~/.npm | |
sudo chown -R `whoami` /usr/local/lib/node_modules | |
sudo chown -R `whoami` /usr/local | |
sudo chown -R `whoami` ~/tmp |
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
<link rel="import" href="../paper-tabs/paper-tabs.html"> | |
<link rel="import" href="../paper-tabs/paper-tab.html"> | |
<link rel="import" href="../paper-button/paper-button.html"> | |
<link rel="import" href="../paper-toast/paper-toast.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { |
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
module Commission | |
class Engine < ::Rails::Engine | |
config.i18n.load_path += Dir[config.root.join('config', 'locales', '**', '*.{rb,yml}')] | |
end | |
end |
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
#!/bin/sh | |
sudo apt-get update | |
sudo apt-get install build-essential git-core curl sqlite3 libsqlite3-dev libxml2-dev libxslt1-dev libreadline-dev libyaml-dev libcurl4-openssl-dev libncurses5-dev libgdbm-dev libffi-dev imagemagick libmagickwand-dev wget | |
sudo aptitude purge ruby | |
sudo rm -rf /usr/bin/ruby | |
wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz | |
tar -xvf ruby-2.1.2.tar.gz |