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
//observable_get | |
@Bindable | |
#if($field.modifierStatic) | |
static ## | |
#end | |
$field.type ## | |
#set($name = $StringUtil.capitalizeWithJavaBeanConvention($StringUtil.sanitizeJavaIdentifier($helper.getPropertyName($field, $project)))) | |
#if ($field.boolean && $field.primitive) | |
is## | |
#else |
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
func frequency(numbers: [Int]) -> [Int: Int] { | |
var frequencyDictionary: [Int:Int] = [:] | |
for number in numbers { | |
if let existentValue = frequencyDictionary[number] { | |
frequencyDictionary[number] = existentValue + 1 | |
} else { | |
frequencyDictionary[number] = 1 | |
} | |
} | |
return frequencyDictionary |
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 Foundation | |
func remove(input: String, first: Int, last: Int) -> String { | |
// we require a variable to manipulate strings | |
let newString = input | |
// modify newString and return the result | |
let firstIndex = newString.index(newString.startIndex, offsetBy: first) | |
let lastIndex = newString.index(newString.endIndex, offsetBy: (last * -1)) |
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
# Autocomplete | |
if [ -f /usr/local/git/contrib/completion/git-completion.bash ]; then | |
. /usr/local/git/contrib/completion/git-completion.bash | |
fi | |
# mostra se existem alterações no projeto (master/branch) | |
GIT_PS1_SHOWDIRTYSTATE=true | |
# necessário para o correto funcionamento da variável ‘__git_ps1’ | |
source /usr/local/git/contrib/completion/git-prompt.sh |
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
allprojects { | |
gradle.projectsEvaluated { | |
tasks.withType(JavaCompile) { | |
options.compilerArgs << "-Xmaxerrs" << "5000" | |
} | |
} | |
} |
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
#!/usr/bin/env bash | |
# fail if any commands fails | |
set -e | |
# debug log | |
set -x | |
# write your script here | |
#!/bin/bash | |
set -eu |
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
ext { | |
localProp = new Properties() | |
fileName = 'local.properties' | |
if (project.rootProject.file(fileName).exists()) { | |
localProp.load(new FileInputStream(rootProject.file(fileName))) | |
} | |
groupName = "br.com.cetelem.android.components" | |
publishUsername = System.env.PUBLISH_USERNAME != null ? System.env.PUBLISH_USERNAME : localProp["publishUsername"] ?: "" | |
publishPassword = System.env.PUBLISH_PASSWORD != null ? System.env.PUBLISH_PASSWORD : localProp["publishPassword"] ?: "" | |
repoUrl = System.env.REPO_URL != null ? System.env.REPO_URL : localProp["repoUrl"] ?: "" |
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
void main() { | |
Pessoa p = Pessoa("Hernand"); | |
int a = 3; | |
int b = 2; | |
Calculadora calc = Calculadora(); | |
int c = Calculadora.soma(a, b); | |
print("Soma: $c"); | |
print("Soma: ${p.nome}"); | |
} |
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
void main() { | |
Carro c1 = Carro("Fusca"); | |
Carro c2 = Carro("Brasilia"); | |
Carro c3 = Carro("Chevete"); | |
//List<Carro> carros = List<Carro>(); | |
//carros.add(c1); | |
//carros.add(c2); | |
//carros.add(c3); | |
var carros = [c1, c2, c3]; |
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
void main() { | |
Carro c1 = Carro("Fusca"); | |
Carro c2 = Carro("Brasilia"); | |
Carro c3 = Carro("Chevete"); | |
final carros = {1:c1 ,2: c2}; | |
carros[3] = c3; | |
print ("Lista $carros"); |