Skip to content

Instantly share code, notes, and snippets.

View edwvilla's full-sized avatar
:octocat:

Edwin Villa edwvilla

:octocat:
View GitHub Profile
import 'dart:developer';
import 'package:flutter/material.dart';
class CounterNotifier with ChangeNotifier {
int _count = 0;
int get value => _count;
void increment() {
class AuthValidator {
String validatePassword(String value) {
if (value.length < 6)
return 'Contraseña debe ser mayor a 6 caracteres';
else
return null;
}
String validateEmail(String value) {
const String pattern =
@edwvilla
edwvilla / analysis_options.yaml
Created November 27, 2020 22:00
Simply add this in the root directory on any dart project
# Specify analysis options.
#
# Until there are meta linter rules, each desired lint must be explicitly enabled.
# See: https://github.com/dart-lang/linter/issues/288
#
# For a list of lints, see: http://dart-lang.github.io/linter/lints/
# See the configuration guide for more
# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer
#
# There are other similar analysis options files in the flutter repos,
@edwvilla
edwvilla / motospeed_ck62.ahk
Last active June 4, 2021 11:27
My custom keys for autohotkey on a motospeed ck62 keyboard, based on https://gist.github.com/eduardomartines/371b790d1c102bccca6db9a25ad2b464
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetCapsLockState, AlwaysOff
CapsLock & ,:: Send {Del}
CapsLock & .:: Send {End}
CapsLock & k:: Send {Ins}
@edwvilla
edwvilla / motospeed_ck62.ahk
Created October 23, 2020 03:44
My custom keys for autohotkey on a motospeed ck62 keyboard
SetCapsLockState, AlwaysOff
CapsLock & /::Up
CapsLock & SC15D::Down
CapsLock & SC138::Left
CapsLock & SC11D::Right
CapsLock & l::Home
CapsLock & .::End
CapsLock & ,::Delete
CapsLock & `;::PgUp
CapsLock & '::PgDn
import random
def estimate_pi(n):
num_point_circle = 0
num_point_total = 0
for _ in range(n):
x = random.uniform(0, 1)
y = random.uniform(0, 1)
distance = x**2 + y**2