Skip to content

Instantly share code, notes, and snippets.

View wildlyinaccurate's full-sized avatar
🐕‍🦺

Joseph Wynn wildlyinaccurate

🐕‍🦺
View GitHub Profile
@Integralist
Integralist / 1. Designing Systems and Applications.md
Last active June 7, 2020 15:22
Designing Systems and Applications

Designing Systems and Applications

This is a short document of tips and notes I've accumulated while learning more about designing distributed systems and building concurrent applications. It is by no means definitive and merely scratches the surface of what is needed to be considered when designing an architecture expected to handle large scale traffic.

Distributed Systems

Scale out, not up

There reaches a point in your application's design where by merely throwing more hardware at the problem (i.e. "scaling up") will fail to resolve the scalability issues you're encountering.

@alicebartlett
alicebartlett / Hiring-links.md
Last active November 26, 2018 03:41
A while ago I asked twitter for resources on hiring, here are some links:
@shaunbent
shaunbent / 12-col-1008.js
Last active January 27, 2017 11:54
GEL Grid Bookmarklets
// Save the following as bookmark in your browser
javascript:(function(){if(document.getElementsByClassName("gel-grid-overlay").length){document.getElementsByClassName("gel-grid-overlay")[0].remove()}var e="<div class=\"gel-grid-overlay__grid\"><div class=\"gel-grid-overlay__margin\" style=\"left: 0;\"></div>";for(i=0;i<12;i++){e+="<div class=\"gel-grid-overlay__column\"><div class=\"gel-grid-overlay__column-fill\"></div></div>"}e+="<div class=\"gel-grid-overlay__margin\" style=\"right: 0;\"></div>";e+="</div>";var t=document.createElement("div");t.className="gel-grid-overlay";t.innerHTML=e;var n=document.createElement("style");n.innerHTML=".gel-grid-overlay * {-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;);}.gel-grid-overlay {z-index: 2147483647; position: fixed; height: 100%; width: 100%; left: 0; top: 0;}.gel-grid-overlay__grid {position: relative; width: 100%; height: 100%; max-width: 1008px; margin: 0 auto; padding: 0 4px;}.gel-grid-overlay__column {display: inline-

Refactoring with type classes and optics

Often when writing programs and functions, one starts off with concrete types that solve the problem at hand. At some later time, due to emerging requirements or observed patterns, or just to improve code readability and reusability, we refactor to make our code more polymorphic. The importance of not breaking your API typically ranges from nice to have (e.g. minimises rework but not essential) to paramount (e.g. in a popular, foundational library).

//: Playground - noun: a place where people can play
//: http://webyrd.net/scheme-2013/papers/HemannMuKanren2013.pdf
typealias Var = Int
typealias Subst = [(Var, Term)]
typealias State = (Subst, Int)
typealias Goal = State -> Stream
indirect enum Stream {
case Nil, Cons(State, Stream), Lazy(() -> Stream)
[root@arkos ~]# cat /etc/systemd/system/mopidy.service
[Unit]
Description=Mopidy
After=network.target
[Service]
ExecStart=/usr/bin/mopidy --config=/etc/mopidy.conf
[Install]
WantedBy=multi-user.target
@wildlyinaccurate
wildlyinaccurate / hack.sh
Last active December 17, 2015 02:49 — forked from erikh/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://gist.githubusercontent.com/wildlyinaccurate/5539084/raw/hack.sh | sh
#
@wildlyinaccurate
wildlyinaccurate / convert-tabs-and-trim-trailing-whitespace.sh
Last active December 11, 2015 22:59
Convert tabs to 4 spaces and trim any trailing whitespace
# This requires GNU sed (or any sed which supports -i) and expand
find . -type f -printf "sed -i 's/[ \t]*$//' %p && expand -t 4 %p > %p.tmp && mv %p.tmp %p\n" | sh
# It's better to be more specific about which files you want to run the replacement in, e.g.
find . -type f -name *.php -printf "sed -i 's/[ \t]*$//' %p && expand -t 4 %p > %p.tmp && mv %p.tmp %p\n" | sh
# You can use find's -regex option to match multiple extensions (you need to double-escape backslashes in bash):
find . -type f -regex .+\\\.\\\(php\\\|css\\\|js\\\)\$ -printf "sed -i 's/[ \t]*$//' %p && expand -t 4 %p > %p.tmp && mv %p.tmp %p\n" | sh