brew install [email protected]
brew install postgresql@10
https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff
While attempting to explain JavaScript's reduce
method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.
JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List
is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu
/* | |
https://www.smashingmagazine.com/2016/07/improving-user-flow-through-page-transitions/ | |
You can copy paste this code in your console on smashingmagazine.com | |
in order to have cross-fade transition when change page. | |
*/ | |
var cache = {}; | |
function loadPage(url) { | |
if (cache[url]) { |
/* | |
weekly = [ | |
['3/6 - 3/12', 10], | |
['3/12 - 3/19', 13] | |
]; | |
day = [ | |
['3/6', 10] | |
['3/8', 2] | |
]; |
# Middleman - Inline SVG Helper | |
# ------------------------------------------------------------------------------ | |
# | |
# Installation | |
# ------------ | |
# 1. Save this file at `[project_root]/helpers/image_helpers.rb` | |
# 2. Open the project's Gemfile and add this line: `gem "oga"` | |
# 3. Run `bundle install` from the command line | |
# | |
# Note: Restart your local Middleman server (if it's running) before continuing |
angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers']) | |
.run(function(DB) { | |
DB.init(); | |
}); |
#usage: | |
#{% loop_directory directory:images iterator:image filter:*.jpg sort:descending %} | |
# <img src="{{ image }}" /> | |
#{% endloop_directory %} | |
module Jekyll | |
class LoopDirectoryTag < Liquid::Block | |
include Liquid::StandardFilters | |
Syntax = /(#{Liquid::QuotedFragment}+)?/ |