Skip to content

Instantly share code, notes, and snippets.

View vital-edu's full-sized avatar

Eduardo Vital Alencar Cunha vital-edu

View GitHub Profile
@vital-edu
vital-edu / main.dart
Created May 17, 2023 19:55
Dart 3: Breakpoint Issue
void main() {
var data = {
'number': 20,
'canProcess': true,
};
final worker = Worker(data);
print(worker.result);
final result = worker.maybeProcess(data, (data) {
if (data case {'number': final number}) {
@vital-edu
vital-edu / main.dart
Last active January 8, 2023 20:17
Cube 4 Sides
import 'package:flutter/material.dart';
import 'dart:math';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@vital-edu
vital-edu / main.dart
Last active November 2, 2021 20:51
Bitcoin max supply simulation
// #######################################
// ----- bin/bitcoin_simulation.dart -----
// #######################################
import 'dart:math';
import 'package:intl/intl.dart';
// import 'package:bitcoin_ssimulation/chain_params.dart';
// import 'package:bitcoin_simulation/consensus/params.dart';
@vital-edu
vital-edu / add_to_list_and_unfollow.js
Created August 30, 2021 23:46
Script used on Twitter to add person to a list and unfollow them
// This script muust be used in a twitter profile's page to add someone to a list named `listName` and unfollow the person.
let listName = "Flutter" // change this variable value to specify the list's name to where the person will be added to.
let moreBtn = document.querySelector('div[role=button][aria-haspopup=menu][data-testid=userActions]')
moreBtn.click()
let addMemberBtn = document.querySelector('a[href="/i/lists/add_member"]>div')
addMemberBtn.click()
setTimeout(() => {
@vital-edu
vital-edu / challenge.py
Last active August 13, 2020 01:33
Python 3 Challenge
# Python 3
from urllib.parse import urlencode
def gen_url(query_params={}, include_auth=True):
uri = 'http://google.com'
auth_key = 'default_value'
if include_auth:
query_params['default_param'] = auth_key
@vital-edu
vital-edu / a.js
Last active June 17, 2020 16:53
Ref
import verifyJwt from 'security';
import logger from 'logger';
import model from 'model';
function handlePostRequest(request) {
if (request.headers.authorization === null) {
throw Error('Unauthorized');
}
@vital-edu
vital-edu / main.dart
Last active January 18, 2023 08:08
Flutter view with two big buttons
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter view with two big buttons',
debugShowCheckedModeBanner: false,
@vital-edu
vital-edu / main.dart
Last active February 17, 2024 09:15
How to overlap SliverList on a SliverAppBar
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'How to overlap SliverList on a SliverAppBar',
debugShowCheckedModeBanner: false,
@vital-edu
vital-edu / base_ontology.ttl
Last active July 9, 2018 06:18
Nexte Ontology
@prefix : <http://nexte.io/ontology/>.
@prefix users: <http://nexte.io/users/>.
@prefix rules: <http://nexte.io/rules/>.
@prefix challenges: <http://nexte.io/challenges/>.
@prefix clubs: <http://nexte.io/clubs/>.
@prefix rankings: <http://nexte.io/rankings/>.
@prefix positions: <http://nexte.io/positions/>.
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@vital-edu
vital-edu / gist:5665e135dc96dde0f032c2acdc54d132
Created March 16, 2018 14:50 — forked from ingramchen/gist:e2af352bf8b40bb88890fba4f47eccd0
ffmpeg convert gif to mp4, for best cross browser compatibility
### Full command line options
```
ffmpeg -f gif -i FOO.gif -pix_fmt yuv420p -c:v libx264 -movflags +faststart -filter:v crop='floor(in_w/2)*2:floor(in_h/2)*2' BAR.mp4
```
### Notie
* output mp4 is encoded with h264, support Firefox/Chrome/Safari in Windows, Mac OSX, Android, and iOS.