Skip to content

Instantly share code, notes, and snippets.

View dariogabriel113's full-sized avatar
:shipit:
...

Dario Gabriel dariogabriel113

:shipit:
...
  • FCPC - Fundação Cearense de Pesquisa e Cultura
  • Fortaleza - Brazil
View GitHub Profile
const makeRequest = async () => {
try {
const data = JSON.parse(await getJSON())
console.log(data)
} catch (err) {
console.log(err)
}
}
def list = ['Groovy', 'Grails', 'Java']
println(list.count { it.startsWith('G') } == 2)
Integer[] numbers = [1,2,3,4] as Integer[]
println(numbers.count { it > 2 } == 2)
def map = [user: 'dariogabriel113', city: 'Fortaleza', age: 23]
println(map.count { key, value -> key.size() == 3 } == 1)
@dariogabriel113
dariogabriel113 / arrows.dart
Created June 13, 2019 01:06
Dart | Language samples - Arrows
var name = 'Voyager I';
var year = 1977;
var antennaDiameter = 3.7;
var flybyObjects = ['Jupiter', 'Saturn', 'Uranus', 'Neptune'];
var image = {
'tags': ['saturn'],
'url': '//path/to/saturn.jpg'
};
flybyObjects.where((name) => name.contains('turn')).forEach(print);
@dariogabriel113
dariogabriel113 / functions.dart
Created June 13, 2019 00:57
Dart | Language samples - Functions
int fibonacci(int n) {
if(n == 0 || n == 1) return n;
return fibonacci(n - 1) + fibonacci(n - 2);
}
var result = fibonacci(20);
@dariogabriel113
dariogabriel113 / control_flow.dart
Created June 13, 2019 00:52
Dart | Language samples - Control flow statements
var name = 'Voyager I';
var year = 1977;
var antennaDiameter = 3.7;
var flybyObjects = ['Jupiter', 'Saturn', 'Uranus', 'Neptune'];
var image = {
'tags': ['saturn'],
'url': '//path/to/saturn.jpg'
};
if(year >= 2001) {
@dariogabriel113
dariogabriel113 / variables.dart
Created June 13, 2019 00:44
Dart | Language samples - Variables
var name = 'Voyager I';
var year = 1977;
var antennaDiameter = 3.7;
var flybyObjects = ['Jupiter', 'Saturn', 'Uranus', 'Neptune'];
var image = {
'tags': ['saturn'],
'url': '//path/to/saturn.jpg'
};
<?php
$vet01 = array();
$vet01[] = "Sistemas operacionais";
$vet01[] = "Compiladores";
$vet01[] = "Banco de dados";
$vet02 = array(1, 2, 3, 4, 5);
$vet03 = array(0 => 0, 2 => 3, 10 => "item 10");
$vet04 = ['valor 1', 'string 2', 3, 4.0, false];
$vet05 = ["chave1" => 'valor 1', 2, 3, 4, array('item 1', 2 => 0.5)];
void main() {
for (int i = 0; i < 5; i++) {
print('Hello World ${i + 1}!');
}
}
@dariogabriel113
dariogabriel113 / IA-ClassEstado
Created September 7, 2018 17:05
Estado atual de trabalho de IA
class Estado {
List<String> posicoes
int nome
Estado pai
static constraints = {
pai nullable: true
}
}
@dariogabriel113
dariogabriel113 / helloWorld.py
Last active April 12, 2019 16:40
"Hello, World!" with Python
print("Hello, World!")