Skip to content

Instantly share code, notes, and snippets.

@debasishg
debasishg / cache-oblivious.md
Last active March 7, 2026 15:20
Papers related to cache oblivious data structures

Cache Oblivious and Cache Aware Data Structure and Algorithms

  1. Cache-Oblivious Algorithms and Data Structures - Erik Demaine (One of the earliest papers in cache oblivious data structures and algorithms that introduces the cache oblivious model in detail and examines static and dynamic cache oblivious data structures built between 2000-2003)

  2. Cache Oblivious B-Trees - Bender, Demaine, Farch-Colton (This paper presents two dynamic search trees attaining near-optimal performance on any hierarchical memory. One of the fundamental papers in the field where both search trees discussed match the optimal search bound of Θ(1+log (B+1)N) memory transfers)

  3. Cache Oblivious Search Trees via Binary Trees of Small Height - Brodal, Fagerberg, Jacob (The data structure discussed in this paper works on the version of [2] but avoids the use o

@rockon1985
rockon1985 / deploying_nodejs_postgres_on_aws.md
Last active June 29, 2023 06:50
Walkthrough guide to deploy nodejs and postgres app using EC2, nginx and RDS

Deploying nodejs on AWS

1. Create AWS EC2 instance

We would prefer to go with Ubuntu Server 16.04 LTS (HVM) [ami-0d03add87774b12c5] for backward compatibility for older applications. But one can choose any version as per thier preference

2. Install nvm and Nodejs using nvm

import * as Sentry from "@sentry/node";
import imagemin from "imagemin";
import mozjpeg from "imagemin-mozjpeg";
import sharp from "sharp";
import isJpg from "is-jpg";
import * as aws from "aws-sdk";
import { Upload } from "../../types/graphqlUtils";
import { generateFilename } from "./generateFilename";
export const s3 = new aws.S3({
@douglashill
douglashill / KeyboardTableView.swift
Last active March 30, 2023 22:01
A UITableView that allows navigation and selection using a hardware keyboard.
// Douglas Hill, December 2018
// Made for https://douglashill.co/reading-app/
// Find the latest version of this file at https://github.com/douglashill/KeyboardKit
import UIKit
/// A table view that allows navigation and selection using a hardware keyboard.
/// Only supports a single section.
class KeyboardTableView: UITableView {
// These properties may be set or overridden to provide discoverability titles for key commands.
@JamieMason
JamieMason / group-objects-by-property.md
Created September 14, 2018 07:38
Group Array of JavaScript Objects by Key or Property Value

Group Array of JavaScript Objects by Key or Property Value

Implementation

const groupBy = key => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = obj[key];
    objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
    return objectsByKeyValue;
@cklanac
cklanac / challenge-08-one-to-many.md
Last active March 28, 2020 06:52
Challenge 08: One-to-Many

Noteful Challenge - One-to-Many

In this challenge you will create a folders table, create a new router and endpoints for the folders, and update the existing notes endpoints to return folder related data.

Requirements

  • Create a folders table
    • Optionally, alter the default sequence so the folder IDs start at 100
  • Add a folder_id column to the notes table and define the relationship
  • Populate the folders table with sample data and update the notes data to include folders.
@giansalex
giansalex / read-file-postgresql.md
Created January 13, 2018 18:59
Read file and insert data to field - PostgreSQL

First

Create function

create or replace function bytea_import(p_path text, p_result out bytea) 
                   language plpgsql as $$
declare
  l_oid oid;
  r record;
begin
 p_result := '';
@Siemian
Siemian / UIView+Constraints.swift
Last active December 31, 2024 21:06
UIView extension for creating NSLayoutConstraints
//
// UIView+Constraints.swift
// CiLabs
//
// Copyright © 2019 Netguru.co. All rights reserved.
//
import UIKit
typealias Constraint = (_ layoutView: UIView) -> NSLayoutConstraint
@NigelEarle
NigelEarle / Knex-Setup.md
Last active March 15, 2025 16:49
Setup Knex with Node.js

Knex Setup Guide

Create your project directory

Create and initialize your a directory for your Express application.

$ mkdir node-knex-demo
$ cd node-knex-demo
$ npm init