Skip to content

Instantly share code, notes, and snippets.

@Klerith
Klerith / pasos-node-ts-jest.md
Created August 19, 2023 18:35
Note + TypeScript + Jest = Testing

Pasos para configurar Jest con TypeScript, en Node

Documentación oficial sobre Jest

  1. Instalaciones de desarrollo (super test es útil para probar Express)
npm install -D jest @types/jest ts-jest supertest

The Interactive Extensions for JavaScript (IxJS)

The Interactive Extensions for JavaScript (IxJS) is a set of methods on top of Iteratable and AsyncIterable serving as a standard library for both. Much like its push-based counterpart, the Interactive Extensions for JavaScript unifies the programming model around pull-based collections, either synchronous in the case of Iterable or asynchronous with AsyncIterable.

Iterable

Starting in ES6, the Symbol.iterator method was introduced to allow for iteration over collections such as Array, Map, Set and even ``Generator. IxJS introduces a number of creation factories and operators that operate on these Iterable` collections lazily. Each factory can be imported from `'ix/iterable'` and operators from `'ix/iterable/operators'` such as the following creating an iterable via `of` and then transforming each item using the `map` operator. You c

#/bin/bash
set -e
# switch to master
git checkout master
# Find all commits added by Gold Fig
commit_ids=$(git log --author=gold-fig --format=%H)
@gsoltis
gsoltis / gold_fig_service_whitelist.txt
Last active May 6, 2024 03:17
Gold Fig Service WhiteList
Airbrake
Airship
Akamai
Amplitude
Apple App Store
Apple Itunes Connect
Asayer
AWS
CircleCI
CloudFlare
@gsoltis
gsoltis / rx.firebase.js
Last active May 6, 2024 03:17
Quick Firebase / RxJS binding prototype
(function () {
var makeCallback = function(eventType, observer) {
if (eventType === 'value') {
return function(snap) {
observer.onNext(snap);
};
} else {
return function(snap, prevName) {
// Wrap into an object, since we can only pass one argument through.
observer.onNext({snapshot: snap, prevName: prevName});
@gsoltis
gsoltis / RxFirebase.java
Last active May 6, 2024 03:16
RxJava Bindings for Firebase
package com.firebase.client;
import com.firebase.client.core.Constants;
import rx.Observable;
import rx.Subscriber;
import rx.functions.Action0;
import rx.functions.Func1;
import rx.subscriptions.Subscriptions;
public class RxFirebase {
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active May 6, 2024 03:16
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@staltz
staltz / app.kt
Last active May 6, 2024 03:15
Cycle giving baby steps into Kotlin
import kotlin.browser.document
import kotlin.browser.window
// Type definitions
native("Cycle")
val Cycle : dynamic = noImpl
native("Cycle.h")
fun h(tagName: String) : VTree = noImpl
@staltz
staltz / dom$.js
Last active May 6, 2024 03:15 — forked from anonymous/dom$.js
import Cycle from 'cyclejs';
const { h, Rx } = Cycle;
// all html/svg element names <<
var elements = [
'a',
'abbr',
'address',
'area',
@staltz
staltz / promises-pyramid.js
Created May 3, 2014 06:05
Q promises pyramid of doom
var Q = require('q');
function delaydo(x) {
var deferred = Q.defer();
setTimeout(function() {
if (x === 2) {
console.log("reject: "+x);
deferred.reject(x);
}
else {