Skip to content

Instantly share code, notes, and snippets.

View alexcmgit's full-sized avatar

Alex Castro alexcmgit

View GitHub Profile
double ruleOfThree({double x1, double y1, double x2}){
final y2 = x2 * y1 / x1;
return y2;
}
import 'dart:math' as math;
void main() {
var tests = [
{'num': 1234, 'digits': 1},
{'num': 100000000, 'digits': 1},
{'num': 299792458, 'digits': 1},
{'num': 759878, 'digits': 1},
{'num': 759878, 'digits': 0},
{'num': 123, 'digits': 1},
import 'dart:math' as math;
void main() {
var tests = [
{'num': 1234, 'digits': 1},
{'num': 100000000, 'digits': 1},
{'num': 299792458, 'digits': 1},
{'num': 759878, 'digits': 1},
{'num': 759878, 'digits': 0},
{'num': 123, 'digits': 1},
bool _hasMatch(String target, String text) {
text = text.replaceAll(' ', '');
target = target.replaceAll(' ', '');
text = text.toLowerCase();
target = target.toLowerCase();
final query = text.split('');
final ids = <int>[];
@alexcmgit
alexcmgit / portal-do-aluno-helper.js
Last active December 2, 2020 16:48
Script que uso pra rodar no console do site portal do aluno pra somar as notas de todos os bimestres e mostrar a nota final (é só um atalho pra não ficar precisando somar as notas na calculadora)
try {
var badges = document.querySelectorAll("span.badge");
} catch (e) {}
badges = document.querySelectorAll("span.badge");
total = 0;
badges.forEach((b) => {
let v;
import 'package:url_launcher/url_launcher.dart';
import 'dart:math';
class Utils {
static int randomInt(int min, int max) {
final random = Random();
return random.nextInt(max - min + 1) + min;
}
::-webkit-scrollbar {
width: 12px;
background-color: transparent;
}
::-webkit-scrollbar-button {
display: none;
width: 0;
height: 0;
}
.theme-dark {
--header-primary: #fff;
--header-secondary: #b9bbbe;
--text-normal: #dcddde;
--text-muted: #72767d;
--text-link: #00b0f4;
--channels-default: #8e9297;
--interactive-normal: #b9bbbe;
--interactive-hover: #dcddde;
--interactive-active: #fff;