Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:

Jared Davis Jared-Prime

:octocat:
View GitHub Profile
@soupi
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
View dev-setup.sh
#!/usr/bin/env bash
# BASH TIPS -
# http://kvz.io/blog/2013/11/21/bash-best-practices/
set -o errexit
set -o nounset
set -o xtrace
# TMUX CONFIG
@mrkgnao
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
JPvRiel / linux_memory_control_to_avoid_swap_thrashing.md
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.
View linux_memory_control_to_avoid_swap_thrashing.md

Overview

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
Jared-Prime / clean_docker_images.py
Created Jan 26, 2016 — forked from DrMavenRebe/clean_docker_images.py
Remove unlinked space from the docker drive
View clean_docker_images.py
#!/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: https://github.com/docker/docker/issues/6354
"""
import logging
import os
@jamtur01
jamtur01 / ladder.md
Last active Feb 27, 2021
Kickstarter Engineering Ladder
View gist:e051898d129b44e2f502
package main
import (
"bufio"
"encoding/csv"
"encoding/json"
"fmt"
"io"
"os"
"path/filepath"
@markpapadakis
markpapadakis / simpleStacklessCorosActors.cpp
Last active Jun 21, 2020
A very simple (first take) implementation of stack-less coroutines/actors
View simpleStacklessCorosActors.cpp
// https://gist.github.com/markpapadakis/8dba5c480c13b12a056e (example)
// https://medium.com/@markpapadakis/high-performance-services-using-coroutines-ac8e9f54d727
#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
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
end
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"
end
create_table "users", :force => true do |t|
t.string "name"
end