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
# LABEL maintainer="Iago Caldeira <[email protected]>" | |
FROM openjdk:8u201-jdk-alpine3.9 as openjdk | |
# Link javac installation | |
RUN ln -s /usr/lib/jvm/java-1.8-openjdk/bin/javac /usr/bin/javac | |
# Node Installation | |
RUN apk add nodejs-current-npm bash && rm -rf /var/cache/apk/* | |
# ENV NPM_CONFIG_PREFIX=/home/node/.npm-global \ |
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
// Lista | |
AC, Acre | |
AL, Alagoas | |
AP, Amapá | |
AM, Amazonas | |
BA, Bahia | |
CE, Ceará | |
DF, Distrito Federal | |
ES, Espirito Santo |
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
# Copyright (C) 2016 Martina Pugliese | |
from boto3 import resource | |
from boto3.dynamodb.conditions import Key | |
# The boto3 dynamoDB resource | |
dynamodb_resource = resource('dynamodb') | |
def get_table_metadata(table_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
#!/bin/sh | |
# Make sure to: | |
# 1) Name this file `backup.sh` and place it in /home/ubuntu | |
# 2) Run sudo apt-get install awscli to install the AWSCLI | |
# 3) Run aws configure (enter s3-authorized IAM user and specify region) | |
# 4) Fill in DB host + name | |
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket) | |
# 6) Run chmod +x backup.sh | |
# 7) Test it out via ./backup.sh |
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
python -c 'import random; import string; print "".join([random.SystemRandom().choice(string.digits + string.letters + "!#$%&\()*+,-./:;<=>?@[]^_{|}~" ) for i in range(100)])' |
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
app.factory('Client', function() { | |
function Client(obj) { | |
obj.created = new Date(obj.created); | |
angular.extend(this, obj); | |
} | |
return Client; | |
}); |
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
from collections import defaultdict | |
import json | |
json_str = '''[{ "metodo": "metodo1()", "statements": 134}, | |
{ "metodo": "metodo2()", "statements": 124}, | |
{ "metodo": "metodo3()", "statements": 110}, | |
{ "metodo": "metodo3()", "statements": 228}, | |
{ "metodo": "metodo4()", "statements": 50}]''' | |
lst = json.loads(json_str) |
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
#!/usr/bin/env ruby | |
FORBIDDEN = [ | |
/\bdebugger\b/, | |
/\bprint\b/, | |
/\bconsole\.*\b/, | |
/\bipdb\b/, | |
/\b\.only\b/, | |
] | |
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
data.forEach(function (harvest) { | |
var values = harvest.values, | |
h = new Harvest(); | |
h.id = harvest.id; | |
h.uuid = harvest.uuid; | |
h.device = harvest.device; | |
h.date = harvest.created; | |
h.values = []; |
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
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
NewerOlder