Skip to content

Instantly share code, notes, and snippets.

View isaksky's full-sized avatar

Isak Sky isaksky

View GitHub Profile
@chrismccord
chrismccord / upgrade.md
Last active April 7, 2023 12:03
Phoenix 1.2.x to 1.3.0 Upgrade Instructions

If you want a run-down of the 1.3 changes and the design decisions behidn those changes, check out the LonestarElixir Phoenix 1.3 keynote: https://www.youtube.com/watch?v=tMO28ar0lW8

To use the new phx.new project generator, you can install the archive with the following command:

$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez

Bump your phoenix dep

Phoenix v1.3.0 is a backwards compatible release with v1.2.x. To upgrade your existing 1.2.x project, simply bump your phoenix dependency in mix.exs:

@mrange
mrange / data_performance.md
Last active January 4, 2020 10:16
On the topic of data locality and performance

On the topic of data locality and performance

Full source code can be found here

It is well-known that a hard disk has a long delay from that we request the data to that we get the data. Usually we measure the hard disk latency in milliseconds which is an eternity for a CPU. The bandwidth of a hard disk is decent good as SSD:s today can reach 1 GiB/second.

What is less known is that RAM has the same characteristics, bad latency with good bandwidth.

You can measure RAM latency and badndwidth using Intel® Memory Latency Checker. On my machine the RAM latency under semi-high load is ~120 ns (The 3r:1w bandwidth is 16GiB/second). This means that the CPU on my machine has to wait for ~400 cycles for data, an eternity.

@mrange
mrange / fsharp_advent_2016_12_10.md
Last active December 14, 2019 21:44
F# Advent 2016 (English) - December 10 - Implementing a persistent hash map.
@madskristensen
madskristensen / devenv.pkgundef
Last active February 21, 2022 13:04
Disable built-in Visual Studio packages
//********************************************************//
// HOW TO:
// Create a file called devenv.pkgundef in the same directory as devenv.exe.
// It's usually located at C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
// Then call "devenv.exe /updateconfiguration" from an elevated command prompt.
// REMARKS:
// Each GUID below represent a package that Visual Studio is loading. This is the
// list of package that I personally don't ever use. You can modify the list of
@CRogers
CRogers / 0_FParsecTrace.fs
Last active February 8, 2020 21:41
A pretty printed debug tracer for FParsec - like [the example from the docs](http://www.quanttec.com/fparsec/users-guide/debugging-a-parser.html#tracing-a-parser) but with nicer syntax and saves the output in `UserData.Debug`. Use the same ways as in the docs - `parser <!> "label"` will trace the entrance, exit, result and data produced by `pars…
module FParsecTrace
open FParsec
open FParsec.Primitives
open FParsec.CharParsers
open System.Text
type DebugInfo = { Message: string; Indent: int }
type UserState = { mutable Debug: DebugInfo }
(ns async-test.timeout.core
(:require [cljs.core.async :refer [chan close!]])
(:require-macros
[cljs.core.async.macros :as m :refer [go]]))
(defn timeout [ms]
(let [c (chan)]
(js/setTimeout (fn [] (close! c)) ms)
c))
@mediabounds
mediabounds / floatsign.sh
Last active March 31, 2024 18:43
A small bash script to re-sign iOS applications.
# !/bin/bash
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
@sanxiyn
sanxiyn / lisp.c
Created August 14, 2010 04:16
Lisp
#include <assert.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
enum type {
NIL,