Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working/Learning and Hackathon from home

Léo Moraes leohmoraes

🏠
Working/Learning and Hackathon from home
View GitHub Profile
@leohmoraes
leohmoraes / gist:a028fbac9d198674caa27d574a70365b
Created Sep 21, 2021 — forked from mhawksey/gist:1442370
Google Apps Script to read JSON and write to sheet
View gist:a028fbac9d198674caa27d574a70365b
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = JSON.parse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}
@leohmoraes
leohmoraes / flutter_splashscreen.dart
Created Jul 21, 2021 — forked from hariprasadms/flutter_splashscreen.dart
A example code to show how splash screen can added to flutter apps
View flutter_splashscreen.dart
import 'package:fire_table_demo/home_page/landingpage.dart';
import 'package:flutter/material.dart';
import 'package:splash_screen_view/SplashScreenView.dart';
class SplashScreenDemo extends StatefulWidget {
SplashScreenDemo({Key key}) : super(key: key);
@override
_SplashScreenDemoState createState() => _SplashScreenDemoState();
}
View tree.sh
# Use a FOR loop for each file in 'model_out/'
for file in my_r_scripts /*
do
# Create a CASE statement for each file's contents
case $(cat $file) in
# Match on tree and non-tree models
*"Random Forest"*|*GBM*|*XGBoost*)
mv $file tree_models/ ;;
*KNN*|*Logistic*)
rm $file ;;
@leohmoraes
leohmoraes / index.pug
Created Nov 7, 2020
Login Form - Modal
View index.pug
// Form
.form
.form-toggle
.form-panel.one
.form-header
h1 Account Login
.form-content
form
.form-group
label(for='username') Username
@leohmoraes
leohmoraes / main.dart
Last active Aug 15, 2020
Ep03 - Dart - Funcoes puras e transparencia referencial
View main.dart
//https://youtu.be/4EzUtx-Q58I?t=1769
//Funcoes puras e transparencia referencial
import 'dart:math';
/// Funcao pura = sem side-effects
/// Altera somente as variaveis intenas
/// Doubles [n].
int double(int n) => n * 2;
@leohmoraes
leohmoraes / main.dart
Last active Aug 13, 2020
dart2 - High Order Function
View main.dart
// https://youtu.be/4EzUtx-Q58I?t=1370
// High-order Function
int MyInt = 10;
// Add 1 to [1] //adiciona 1
int add1(int a) => a + 1;
//Halve [a] //metade
@leohmoraes
leohmoraes / main.dart
Last active Aug 13, 2020
Dart Ep01 - Exemplo de Lambda com Dart
View main.dart
void main() {
// for (int i = 0; i < 5; i++) {
// print('hello ${i + 1}');
// }
print((True));
print((False));
print("NOT");
print(not(True));
View air_hockey.dart
import 'dart:async';
import 'dart:math' as math;
import 'package:flutter/material.dart';
class AirHockey extends StatefulWidget {
@override
_AirHockeyState createState() => _AirHockeyState();
}