Skip to content

Instantly share code, notes, and snippets.


Jared Davis Jared-Prime

View GitHub Profile
soupi / Json.hs
Last active Nov 11, 2019
A simple JSON EDSL
View Json.hs
{- | An EDSL for defining and printing JSON values
import Data.List (intercalate)
-- JSON Model --
-- | The JSONValue data type represents a JSON Value
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o xtrace
mrkgnao / Neural.idr
Last active Feb 11, 2020
A quick Idris implementation of @mstksg's "dependent Haskell" neural networks
View Neural.idr
module Main
import Data.Vect
-- %hide transpose
dot : Num a => Vect n a -> Vect n a -> a
dot va vb = foldr (+) 0 $ zipWith (*) va vb
Matrix : (rows : Nat) -> (cols : Nat) -> Type -> Type
JPvRiel /
Created Nov 7, 2016
Notes on linux memory management options to prioritize and control memory access using older ulimits, newer cgroups and overcommit policy settings. Mostly as an attempt to keep a desktop environment responsive and avoid swap thrashing under high memory pressure.


Some notes about:

  • Explaining why current day Linux memory swap thrashing still happens (as of 2016).
  • Mitigating "stop the world" type thrashing issues on a Linux workstation when it's under high memory pressure and where responsiveness is more important than process completion.
  • Prioritizing and limiting memory use.
  • Older ulimit versus newer CGroup options.

These notes assume some basic background knowledge about memory management, ulimits and cgroups.

Jared-Prime /
Created Jan 26, 2016 — forked from DrMavenRebe/
Remove unlinked space from the docker drive
#!/usr/bin/env python
Check all existing Docker containers for their mapped paths, and then purge any
zombie directories in docker's volumes directory which don't correspond to an
existing container.
Taken from:
import logging
import os
jamtur01 /
Last active Feb 27, 2021
Kickstarter Engineering Ladder
View gist:e051898d129b44e2f502
package main
import (
markpapadakis / simpleStacklessCorosActors.cpp
Last active Jun 21, 2020
A very simple (first take) implementation of stack-less coroutines/actors
View simpleStacklessCorosActors.cpp
// (example)
#include <switch.h>
#include <switch_print.h>
#include <switch_ll.h>
#include <switch_bitops.h>
#include <md5.h>
#include <text.h>
#include <network.h>
Gonzih / futures.rb
Last active Aug 29, 2015
Fun with cuncurrency in jruby
View futures.rb
class Future
include java.util.concurrent.Callable
@@executor = java.util.concurrent.Executors::newFixedThreadPool(5)
def initialize(&block)
@block = block
def on_success(&block)
View gist:2959954
ActiveRecord::Schema.define(:version => 20120620132905) do
create_table "tasks", :force => true do |t|
t.string "name"
t.integer "sender_id"
t.integer "receiver_id"
create_table "users", :force => true do |t|
t.string "name"