| #!/bin/zsh | |
| # include this file in your shell config | |
| autoload -Uz add-zsh-hook | |
| # this file comes from installing https://github.com/romkatv/gitstatus | |
| SOURCE "${HOMEBREW_PREFIX:-/usr/local}/opt/gitstatus/gitstatus.plugin.zsh" || return | |
| gitstatusd_instance='GSD' | |
| # the following are a mystery - why do they define the fn names with $1? |
| /** | |
| * Syncs your personal calendar with your work calendar as 'busy' events. | |
| */ | |
| // WARNING: This script has the potential to delete events! Audit the code and run with care. | |
| // The script *should* only delete events it has previously created, but bugs are possible! | |
| // How to use | |
| // ========== | |
| // 1. Share your personal calendar with your work account using the free/busy option. |
| // ******************* | |
| // Contributors: | |
| // - Andrew Smith (@AndrewSouthpaw) | |
| // - Shaun Mosley (@Shaunm44) | |
| // ******************* | |
| // This setup will allow you to synchronize personal events from one calendar (the "secondary calendar") | |
| // to another calendar, e.g. work (the "primary calendar"), but obfuscate the details. Then your coworkers | |
| // know when you're busy but don't get to see the personal details. | |
| // |
| import { useEffect, useLayoutEffect } from 'react'; | |
| // eslint-disable-next-line max-len | |
| // See https://github.com/reduxjs/react-redux/blob/316467a/src/hooks/useSelector.js#L6-L15 | |
| export const useIsomorphicLayoutEffect = | |
| typeof window !== 'undefined' ? useLayoutEffect : useEffect; | |
| export const useServerNoopLayoutEffect = | |
| typeof window !== 'undefined' ? useLayoutEffect : () => ({}); |
| # A Firefox Quantum ViewSourceWith replacement for Windows | |
| # | |
| # Usage: | |
| # (1) Save as C:\path\to\script.ps1 | |
| # (2) In order to run your own powershell scripts, start PowerShell | |
| # as Administrator and run the command | |
| # | |
| # Set-ExecutionPolicy RemoteSigned | |
| # | |
| # (2) You can test the proper running (from a user cmd): |
| home := $${HOME} | |
| shell := /bin/bash | |
| nix := /nix/var/nix | |
| nix_darwin := /run | |
| brew := /opt/homebrew | |
| key := id_ed25519 | |
| public_key := .ssh/$(key).pub | |
| github_key := .ssh/github.txt |
CertSimple just wrote a blog post arguing ES2017's async/await was the best thing to happen with JavaScript. I wholeheartedly agree.
In short, one of the (few?) good things about JavaScript used to be how well it handled asynchronous requests. This was mostly thanks to its Scheme-inherited implementation of functions and closures. That, though, was also one of its worst faults, because it led to the "callback hell", an seemingly unavoidable pattern that made highly asynchronous JS code almost unreadable. Many solutions attempted to solve that, but most failed. Promises almost did it, but failed too. Finally, async/await is here and, combined with Promises, it solves the problem for good. On this post, I'll explain why that is the case and trace a link between promises, async/await, the do-notation and monads.
First, let's illustrate the 3 styles by implementing
| vec3 gammaCorrect(vec3 color, float gamma){ | |
| return pow(color, vec3(1.0/gamma)); | |
| } | |
| vec3 levelRange(vec3 color, float minInput, float maxInput){ | |
| return min(max(color - vec3(minInput), vec3(0.0)) / (vec3(maxInput) - vec3(minInput)), vec3(1.0)); | |
| } | |
| vec3 finalLevels(vec3 color, float minInput, float gamma, float maxInput){ | |
| return gammaCorrect(levelRange(color, minInput, maxInput), gamma); |
| (set-env! :dependencies '[ | |
| [org.clojure/clojure "1.8.0" :scope "provided"] | |
| [org.clojure/clojurescript "1.9.89" :scope "provided"] | |
| [ajchemist/boot-figwheel "0.5.4-5"] ;; latest release | |
| [org.clojure/tools.nrepl "0.2.12" :scope "test"] | |
| [com.cemerick/piggieback "0.2.1" :scope "test"] | |
| [figwheel-sidecar "0.5.4-5" :scope "test"] | |
| [pandeiro/boot-http "0.7.2" :scope "test"]]) |