Skip to content

Instantly share code, notes, and snippets.


slidenerd slidenerd

View GitHub Profile
slidenerd /
Created Jun 20, 2019 — forked from calvinh8/
MongoDB Setup Guide for AWS EC2 Instances with Auth Enabled
slidenerd / benchmarks.js
Created May 14, 2018
JS Dynamic Table Insert Rows Benchmark with different methods
View benchmarks.js
<link rel="stylesheet" href="" />
<div id="status"></div>
<table id = "data" class="d-none">
<script src=""></script>
<script src=""></script>
<script src=""></script>
slidenerd / mongodbtestalerts.js
Created May 12, 2018
test mongodb alerts with aggregation pipeline
View mongodbtestalerts.js
fs = require('fs'),
fse = require('fs-extra'),
MongoClient = require('mongodb').MongoClient,
mongoose = require('mongoose'),
ObjectID = require('mongodb').ObjectID,
request = require('request')
const includes = ["AUD", "BRL", "CAD", "CHF", "CLP", "CNY", "CZK", "DKK", "EUR", "GBP", "HKD", "HUF", "IDR", "ILS", "INR", "JPY", "KRW", "MXN", "MYR", "NOK", "NZD", "PHP", "PKR", "PLN", "RUB", "SEK", "SGD", "THB", "TRY", "TWD", "USD", "ZAR"]
slidenerd /
Created May 1, 2018
Python SQLite Benchmarks
import sqlite3
import time
import random
import string
import os
import timeit
from functools import wraps
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
import threading
import os
slidenerd / flatten.js
Created Aug 19, 2016
Inspired from gdibble
View flatten.js
function flattenObject(ob) {
let toReturn = {};
let flatObject;
for (let i in ob) {
console.log(i+ ' ' + typeof(ob[i]));
if (!ob.hasOwnProperty(i)) {
//Exclude arrays from the final result
//Check this
slidenerd /
Last active Jul 10, 2020
A single adapter that supports Cursor + an optional header + optional footer
import android.database.Cursor;
import android.view.View;
import android.view.ViewGroup;
public abstract class RecyclerCursorAdapter<U, V extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements OnSwipeListener {
//The number of headers to be displayed by default if child classes want a header
public static final int HEADER_COUNT = 1;
//The number of footers to be displated by default if child classes want a footer