Skip to content

Instantly share code, notes, and snippets.

View Wigny's full-sized avatar

Wígny Almeida Wigny

View GitHub Profile

Step 1

Run on terminal

heroku create --buildpack hashnuke/elixir

Step 2

Create file elixir_buildpack.config with content:

elixir_version=<VERSION>
void main() {
var n = <int>[54, 1, 30, 4, 0];
for (var i = 0; i < n.length; i++) {
for (var j = 0; j < n.length - 1; j++) {
var maior = 0;
if (n[j] > n[j + 1]) {
maior = n[j];
n[j] = n[j + 1];
class Aluno {
String nome;
int idade;
Aluno(String nome, int idade) {
this.nome = nome;
this.idade = idade;
}
}
@Wigny
Wigny / filereader-to-rxjs.ts
Last active June 5, 2020 13:31
FileReader for RxJS
private readFile = (blob: Blob): Observable<string> => new Observable((obs: Subscriber<string>) => {
if (!(blob instanceof Blob)) {
obs.error(new Error('`blob` must be an instance of File or Blob.'));
return;
}
const reader = new FileReader();
reader.onerror = err => obs.error(err);
reader.onabort = err => obs.error(err);