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).
# 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 |
#!/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 | |
# |
[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 |
//: 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) |
// 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- |
A while ago I did some rage tweeting about job ads. Here is a list of helpful things people sent me to read then and since:
- (diverse hiring generally) https://modelviewculture.com/pieces/25-tips-for-diverse-hiring
- (hiring and retaining women) http://geekfeminism.wikia.com/wiki/HOWTO_recruit_and_retain_women_in_tech_workplaces
- (Buzzfeed's approach to building a diverse team) http://www.buzzfeed.com/bensmith/what-were-doing-to-keep-building-a-diverse-editorial-operati#3jjmnvr
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.
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.
Original text here: https://whydavewhy.com/2013/08/16/loyalty-and-layoffs/ |
It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.