Skip to content

Instantly share code, notes, and snippets.

@etruta
etruta / main.go
Last active July 15, 2022 15:26
replibyte-cpf-transformer-wasm
package main
import (
"fmt"
"github.com/mvrilo/go-cpf"
)
func main() {
fmt.Println(cpf.GeneratePretty())
import UIKit
import RxSwift
import RxCocoa
import SJFluidSegmentedControl
func castOrThrow<T>(_ resultType: T.Type, _ object: Any) throws -> T {
guard let returnValue = object as? T else {
throw RxCocoaError.castingError(object: object, targetType: resultType)
}
return returnValue
import UIKit
import RxSwift
import RxCocoa
import NVActivityIndicatorView
extension Reactive where Base: NVActivityIndicatorView {
public var isAnimating: Binder<Bool> {
return Binder(self.base) { activityIndicator, active in
if active {
activityIndicator.startAnimating()
@etruta
etruta / passageiros_transportados_31012018.csv
Created March 6, 2018 14:14
Passageiros Transportados - 31/01/2018
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 5.
"Data","Tipo","Area","Empresa","Linha","Passageiros Pagtes Em Dinheiro","Passageiros Pagtes Comum","Passageiros Pgts Bu Comum M","Passageiros Pagtes Estudante","Passageiros Pgts Bu Est Mensal","Passageiros Pagtes Bu Vt","Passageiros Pgts Bu Vt Mensal","Passageiros Pagtes Int M/Cptm","Passageiros Pgts Int M/Cptm M","Passageiros Pagantes","Passageiros Int Ônibus->Ônibus","Passageiros Com Gratuidade","Passageiros Com Gratuidade Est","Tot Passageiros Transportados"
"31-Jan-17","CONCESSAO","AREA 1","GATO PRETO","N10511 - TERM CACHOEIRINHA/TERM LAPA","5","24","13","0","0","14","15","0","2","73","85","13","0","171"
"31-Jan-17","CONCESSAO","AREA 1","GATO PRETO","N14311 - METRO BARRA FUNDA/MORRO GRANDE","1","9","3","0","0","16","2","3","5","39","9","5","1","54"
"31-Jan-17","CONCESSAO","AREA 1","GATO PRETO","800010 - TERM LAPA/PCA RAMOS","613","1566","453","45","0","1072","135","272","115","4271","2994","1622","2","8889"
"31-Jan-17","CONCESSAO","AREA 1","GATO PRETO","830010 - TERM PIRITUBA/TERM LAPA","61","183","38","7
@etruta
etruta / linhas_extintas.csv
Created March 6, 2018 13:15
Linhas que serão extintas
1012-10 TERM. JD. BRITANIA – JD. MONTE BELO
1017-10 PERUS – CONEXÃO VL. IÓRIO
1020-10 PERUS – CONEXÃO VL. IÓRIO
1034-10 VL. IARA – CONEXÃO VL. IÓRIO
1036-10 COHAB BRASILÂNDIA – CONEXÃO VL. IÓRIO
1177-31 TERM. A. E. CARVALHO – LUZ
1178-31 SÃO MIGUEL – PÇA. DO CORREIO
1178-32 ABEL TAVARES – PÇA. DO CORREIO
1178-33 PÇA. DO CORREIO – SÃO MIGUEL
1178-42 CONJ. HAB. VL. SÍLVIA – PÇA. DO CORREIO
<?php
header("Content-type: application/json");
$apiKey = "<YOUR LIVESTREAM API KEY>";
$scope = "readonly";
if ($_GET[scope] == "all" || $_GET[scope] == "playback") {
$scope = $_GET[scope];
}
@etruta
etruta / alloy.js
Last active October 25, 2018 18:40
Titanium: Another way to handle pause and resume event for android
Alloy.Globals.wasInForeGround = true;
if(OS_ANDROID) {
var androidServiceIntent = Ti.Android.createServiceIntent({ url: "foreground.service.js" });
androidServiceIntent.putExtra('interval', 3000);
Ti.Android.startService(androidServiceIntent);
}
Ti.App.addEventListener('resumed', function(e) {
Ti.API.log("RESUMED YEAH!");
// Photoshop Script to Create iPhone Icons from iTunesArtwork
//
// WARNING!!! In the rare case that there are name collisions, this script will
// overwrite (delete perminently) files in the same folder in which the selected
// iTunesArtwork file is located. Therefore, to be safe, before running the
// script, it's best to make sure the selected iTuensArtwork file is the only
// file in its containing folder.
//
// Copyright (c) 2010 Matt Di Pasquale
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com