Skip to content

Instantly share code, notes, and snippets.

View emanuel-braz's full-sized avatar
🐦
Going down the rabbit hole 🐇 🐇 🐇

Emanuel Braz emanuel-braz

🐦
Going down the rabbit hole 🐇 🐇 🐇
  • Vitat
  • São Paulo, Brazil
View GitHub Profile
@emanuel-braz
emanuel-braz / pod_clean.md
Last active June 28, 2022 19:12
flutter pod clean install - cocoapod

Erro "CocoaPods not installed or not in valid state"

  • Feche o VSCode e o simulador iOS
  • Rode o script "pod_clean.sh" na raiz do projeto
  • Abra o VSCode e o simulador iOS
  • Rode o projeto
@zjor
zjor / transform_streams_example.dart
Created March 2, 2020 12:47
Example of stream debouncing and throttling
import 'dart:async';
import 'dart:math';
import 'package:stream_transform/stream_transform.dart';
StreamController<int> controller = StreamController<int>.broadcast();
void probe(int id, int delay) {
print("Submitted(ID: $id; delay: $delay)");
controller.add(id);
}
@thetrav
thetrav / api.dart
Last active June 10, 2020 20:22
Upload file to server
import 'package:http/http.dart' as http;
import 'package:http_parser/http_parser.dart';
Future<http.Response> uploadFile(
String url,
Map<String, String> headers,
Map<String, String> fields,
String fileName,
List<int> fileBytes) async {
var request = new http.MultipartRequest("POST", Uri.parse(url));
@heat
heat / rxjs-test.js
Created March 22, 2019 21:40
rxjs operations / subject
const expect = require('chai').expect;
const EventEmitter = require('events');
const rxjs = require('rxjs');
const { ajax } = require('rxjs/ajax');
const { debounce, debounceTime, distinctUntilChanged, switchMap, tap } = require('rxjs/operators');
describe('A emitter', function () {
it('should emit something', async function (done) {