Skip to content

Instantly share code, notes, and snippets.

:shipit:
...

Dario Gabriel dariogabriel113

:shipit:
...
  • FCPC - Fundação Cearense de Pesquisa e Cultura
  • Fortaleza - Brazil
Block or report user

Report or block dariogabriel113

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View catch-async.js
const makeRequest = async () => {
try {
const data = JSON.parse(await getJSON())
console.log(data)
} catch (err) {
console.log(err)
}
}
View countOccurrences.groovy
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 Jun 13, 2019
Dart | Language samples - Arrows
View arrows.dart
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 Jun 13, 2019
Dart | Language samples - Functions
View functions.dart
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 Jun 13, 2019
Dart | Language samples - Control flow statements
View control_flow.dart
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 Jun 13, 2019
Dart | Language samples - Variables
View variables.dart
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'
};
View vetores.php
<?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)];
View helloworld.dart
void main() {
for (int i = 0; i < 5; i++) {
print('Hello World ${i + 1}!');
}
}
View createVariablesAndTypes.py
mystring = "hello"
myfloat = 10.0
myint = 20
# testing code
if mystring == "hello":
print("String: %s" % mystring)
if isinstance(myfloat, float) and myfloat == 10.0:
print("Float: %f" % myfloat)
if isinstance(myint, int) and myint == 20:
@dariogabriel113
dariogabriel113 / helloWorld.py
Last active Apr 12, 2019
"Hello, World!" with Python
View helloWorld.py
print("Hello, World!")
You can’t perform that action at this time.