Skip to content

Instantly share code, notes, and snippets.

View abner's full-sized avatar

Ábner Silva de Oliveira abner

View GitHub Profile
@oschannel
oschannel / CHEATSHEET.md
Last active July 21, 2024 20:04
Running PostgreSQL server on Android Phone without rooting

This cheatsheet is for the following video that shows how to Install and Run the PostgreSQL Database server on your Andriod Phone. Watch this video for a complete Demo/Solution: https://youtu.be/7edutr-ALdc

Install Termux:

Once termux is installed open it and use the shell for below commands

  • Install PostgreSQL:

<link rel="shortcut icon" width=32px>
<canvas style="display: none" id="loader" width="16" height="16"></canvas>
<script>
class Loader {
constructor(link, canvas) {
this.link = link;
this.canvas = canvas;
this.context = canvas.getContext('2d');
this.context.lineWidth = 2;
@abner
abner / scp-with-compression.sh
Created February 19, 2019 19:43
Copy with SCP from remote server using compression
#!/bin/bash
ssh root@10.139.7.126 "cd /home/abner/target-folder; tar zc data-bkp --verbose" | tar zx
@getify
getify / 1.md
Last active October 15, 2020 01:44
BetterPromise: a strawman experiment in subclassing Promise and "fixing" a bunch of its awkward/bad parts

Some things that are "better" with this BetterPromise implementation:

  • BetterPromise # then(..) accepts a BetterPromise (or Promise) instance passed directly, instead of requiring a function to return it, so that the promise is linked into the chain.

    var p = BetterPromise.resolve(42);
    
    var q = Promise.resolve(10);
    
    p.then(console.log).then(q).then(console.log);
@abner
abner / ArrayToSingleResult.java
Last active January 18, 2018 01:46
Java - From Array Observable into a Array mapped from multiple Single operations
import io.vertx.core.json.JsonArray;
import rx.Observable;
import rx.Single;
/**
* @author abner2
*/
public class RxPlayground {
public static void main(String[] args) {
@jkrems
jkrems / es-module-history.md
Last active November 5, 2023 19:35
History of ES modules

Modules - History & Future

History

@adrianoluis
adrianoluis / StringUtil.kt
Created August 10, 2017 19:33
Simple class to slugify text in Kotlin.
import java.text.Normalizer
object StringUtil {
fun slugify(word: String, replacement: String = "-") = Normalizer
.normalize(word, Normalizer.Form.NFD)
.replace("[^\\p{ASCII}]".toRegex(), "")
.replace("[^a-zA-Z0-9\\s]+".toRegex(), "").trim()
.replace("\\s+".toRegex(), replacement)
.toLowerCase()
@btroncone
btroncone / rxjs_operators_by_example.md
Last active June 15, 2024 07:17
RxJS 5 Operators By Example
@elandau
elandau / StateMachine
Created October 30, 2014 23:22
Rx based state machine
package com.netflix.experiments.rx;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rx.Observable;
import rx.Observable.OnSubscribe;
@zilongshanren
zilongshanren / spidermonkey-android.sh
Created September 29, 2014 05:41
build spidermonkey on android
# options
develop=
release=
RELEASE_DIR="spidermonkey-android"
usage(){
cat << EOF
usage: $0 [options]
Build SpiderMonkey using Android NDK