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 = |
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
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
{ | |
// Place your snippets for Ruby here. Each snippet is defined under a snippet name and has a prefix, body and | |
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
// same ids are connected. | |
// Example: | |
"Debug with pry": { | |
"prefix": "pry", | |
"body": [ |
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
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
check process npm | |
matching "npm" | |
start program = "/bin/su designer -lc 'cd /home/designer/angular-theme && npm start' " | |
stop program = "/usr/bin/killall -9 npm" | |
if cpu usage > 95% for 10 cycles then restart | |
# log to monit.log | |
set logfile /var/log/monit.log |
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
class myTask < Task # myTask is a subclass of Task | |
end | |
module Foo | |
def foo | |
puts 'heyyyyoooo!' | |
end | |
end |
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
<!DOCTYPE html> | |
<html ng-app="SaudeDeAco"> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.js"></script> | |
<meta charset="utf-8"> | |
<title>Saúde de Aço</title> | |
</head> | |
<body ng-controller="mainCtrl"> | |
<h3>Semana atual: {{currentWeek}} </h3> |