Skip to content

Instantly share code, notes, and snippets.

@cgrand
cgrand / gist:564d6e8ad57299f64beb438e4a8b709f
Created July 11, 2020 20:26 — forked from KingCode/gist:773560f4ab5bf91e660a2a26e581b036
cond-let and cond-let| macros, to leverage bindings between test and result expressions, as well as earlier ones (for cond-let)
;; (cond-let
;; (odd? x) [x n] (inc x)
;; (< n 10) [y (inc n)] 10
;; :else n))
;; we want the above to yield
;; (let [x n]
;; (if (odd? x)
;; (inc x)
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active November 4, 2024 07:33
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@bazzargh
bazzargh / ublock
Created February 27, 2018 22:04
ublock rules for twitter misfeatures
! Block friends favourited tweets
twitter.com##.tweet-has-context:not([data-retweeter])
! fake activity
twitter.com##li[data-component-context="generic_activity"]
! since you were away
twitter.com##.TimelineTweetsModule
! don't care what's trending
twitter.com##.trends.Trends.module
@glv
glv / bundler-exec.fish
Last active January 5, 2023 21:45
Automatically prepend "bundle exec" when appropriate (in fish shell).
# This sets up fish so that, if you type a command that should be
# run using Bundler, it first automatically prepends "bundle exec"
# to the command line buffer before executing it. Works for all
# commands found in the "bin" directory of the current bundle.
#
# To override this behavior and run such a command without Bundler,
# prefix with "command" (e.g., `command rake -T`)
#
# Pros (vs binstubs or aliases):
# * automatically adjusts to bundle changes
@orderthruchaos
orderthruchaos / IEx.exs
Last active November 28, 2019 12:44
A possible q/0 helper for Elixir.IEx.
if ! Enum.member?(:erlang.loaded, IEx.UserDrv.Config) do
defmodule IEx.UserDrv.Config do
import Process, only: [group_leader: 0]
@moduledoc """
Structure to hold :user_drv configuration information.
"""
defstruct node: Node.self, pid: nil, port: nil, leader: group_leader
@semperos
semperos / div.clj
Last active September 11, 2015 22:12 — forked from gfmurphy/Div.hs
Readability
(defn digits
"Generate a list of digits contained in the number"
[number]
(loop [found-digits '() base (quot number 10) digit (rem number 10)]
(let [found-digits (conj found-digits (if (neg? digit) (- digit) digit))]
(if (zero? base)
found-digits
(recur found-digits (quot base 10) (rem base 10))))))
(defn divisible-digits

Reciprocal Needs in the Employment Relation

We can look at two sides of the management coin: What do the individuals get out of it? And what benefit does the whole system derive from it?

I will disregard any benefits that accrue to managers just by holding the position of managing. Those are just circular logic. Circular logic abounds in discussions of management and hierarchy. For example, consider status reports. It will be said that status reports are necessary so managers know what their employees are working on. It’s

@rcrowley
rcrowley / bad-side-effects-on-mac-osx.sh
Last active August 29, 2015 13:56
A protip for authors of shell programs. I use this pattern *all the time* for working in a temporary directory and cleaning it up after I'm done but a quirk in how shells interpret failures in command substitution caused a program like these to remove my coworker's home directory when he ran said program on Mac OS X, which doesn't have `mktemp -d`.
set -e
# Looks clever, is short, but removes your working directory on Mac OS X
# where `mktemp -d` fails.
cd "$(mktemp -d)"
trap "rm -rf \"$PWD\"" EXIT INT QUIT TERM
# ...

I'm writing in response to events that have recently come to light involving a sexual assault at a tech conference. Background information can be found [here][1], [here][2], and [here][3] as well as on twitter and google.


I've been watching this from the sidelines, and I've been wrestling with several questions that I can't seem to shake and that I really don't have answers to.

I wear many hats, both in the tech community and others. I'm a coder, a speaker, a user group organizer, a conference organizer, and even a boss. Each of those roles colors how I see this, but there's one role that is overpowering in my reaction.

See, I'm a Dad. A dad of two beautiful and innocent girls who are 3 and 2. They have their whole lives in front of them and so the questions I'm struggling with are:

Nature's first green is gold,
Her hardest hue to hold.
Her early leaf's a flower;
But only so an hour.
Then leaf subsides to leaf.
So Eden sank to grief,
So dawn goes down to day.
Timezones: they're here to stay.