This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##----GIT------ | |
alias gs='clear ;and git status' | |
alias gb='git branch' | |
alias gbranch='git rev-parse --abbrev-ref HEAD' #get current branch name | |
alias gl="clear ;and git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
alias gt='git tag' | |
alias grm='git rm' | |
alias gps='git push' | |
alias gbi='git bisect' | |
alias gbg='git bisect good' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dragonEvents = [ | |
{type: 'attack', value: 40, victim: 'dorkman'}, | |
{type: 'sleep', value: 10}, | |
{type: 'attack', value: 20, victim: 'aquaman'}, | |
{type: 'attack', value: 40, victim: 'dorkman'}, | |
] | |
const v = 'dorkman'; | |
const field = 'victim'; | |
const selectVictim = (e) => e[field] === v; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vastly simplified `mixin(..)` example: | |
function mixin( sourceObj, targetObj ) { | |
for (var key in sourceObj) { | |
// only copy if not already present | |
if (!(key in targetObj)) { | |
targetObj[key] = sourceObj[key]; | |
} | |
} | |
return targetObj; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dir = "msgs/" | |
emails = Set(String).new | |
errors_count = 0 | |
msgs = Dir.entries(dir) | |
msgs.each { |msg| | |
next if msg == "." || msg == ".." | |
begin | |
texto = File.read(dir + msg) | |
matches = texto.scan(/[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,64}/) | |
p matches[0][0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:provider/provider.dart'; | |
void main() => runApp(StreamProviderExample()); | |
/// ***************************************************** | |
/// ***************************************************** | |
/// ***************************************************** | |
/// Something important to understand here is that there's a | |
/// fundamental difference between using this StreamProvider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:rxdart/rxdart.dart'; | |
class Counter { | |
Counter._(); | |
static final _instance = Counter._(); | |
factory Counter() { | |
return _instance; | |
} | |
BehaviorSubject _counter = |