This file contains hidden or 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 | |
PROJECT_PATH=$(pwd); | |
APPLY=false | |
IDENTIFIER="" | |
echoerror() { | |
printf "$@\n" 1>&2 | |
} |
This file contains hidden or 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 com.example.app.fragments; | |
import android.content.Intent; | |
import android.content.pm.PackageManager; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import android.support.v4.app.Fragment; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; |
This file contains hidden or 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
# Delete all containers | |
docker rm $(docker ps -aq --filter status="exited" --filter status="dead") | |
docker rm $(docker ps -aq) | |
# Delete all untaged images | |
docker rmi $(docker images --filter "dangling=true" -q | sort -u) | |
http://serverspec.org/resource_types.html | |
https://docs.docker.com/engine/installation/linux/ubuntulinux/#create-a-docker-group |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
#!/usr/bin/env python | |
import logging | |
from pprint import pprint, pformat | |
import sys | |
logging.basicConfig( | |
stream=sys.stdout, | |
# level=logging.DEBUG, | |
format='[%(asctime)s] %(levelname)s:%(name)s:%(lineno)d - %(message)s' |
This file contains hidden or 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 functools import wraps | |
def dec_wrapper(name): | |
def dec(func): | |
@wraps(func) | |
def wrapper(*args, **kw): | |
print(name) | |
print(args) | |
result = func(*args, **kw) | |
print('acabou') |
This file contains hidden or 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 -x | |
case "$OSTYPE" in | |
darwin*) echo "I am a Mac" ;; | |
*) echo "I am not a Mac" ;; | |
esac |
This file contains hidden or 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 SemVer { | |
public int compareVersion(String v1, String v2) { | |
String[] v1Parts = v1.split("\\."); | |
String[] v2Parts = v2.split("\\."); | |
int length = Math.max(v1Parts.length, v2Parts.length); | |
for (int i=0; i<length ;i++) { | |
int numV1 = (i < v1Parts.length)? Integer.parseInt(v1Parts[i]) : 0; | |
int numV2 = (i < v2Parts.length)? Integer.parseInt(v2Parts[i]) : 0; |
This file contains hidden or 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
# Se tiver essa diretiva, a recursividade para, ou seja, | |
# esse é o arquivo raiz da configuração | |
root = true | |
# Comentários podem começar com ; ou # | |
# Pra todos os arquivos | |
# [*] | |
# Para arquivos em extensões abaixo | |
[{*.{c,cpp,conf,cfg,js,py,php,sh},Makefile}] | |
# Defino que serão todos utf-8 |
This file contains hidden or 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
[distutils] | |
index-servers = | |
pypi | |
pypitest | |
[pypi] | |
repository=https://pypi.python.org/pypi | |
username=luiscoms | |
password= |
This file contains hidden or 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 timeit | |
black_list = ["status", "components", "exposed_id", "external_id", "gaucha_id", "publish_scheduled", | |
"created", "origin_link", "canonical", "friendly_title", "friendly_title_history"] | |
input_data = { | |
"x": 1, | |
"_id": 1, | |
"_created": 1, | |
"_updated": 1, |