Skip to content

Instantly share code, notes, and snippets.

;; Auto-scrolling ==============================================================
(defn scroll! [el start end time]
(.play (goog.fx.dom.Scroll. el (clj->js start) (clj->js end) time)))
(defn scrolled-to-end? [el tolerance]
;; at-end?: element.scrollHeight - element.scrollTop === element.clientHeight
(> tolerance (- (.-scrollHeight el) (.-scrollTop el) (.-clientHeight el))))
(defn autoscroll-list [{:keys [children class scroll?] :as opts}]
@allgress
allgress / reagent_datascript.cljs
Last active February 16, 2023 21:16
Test use of DataScript for state management of Reagent views.
(ns reagent-test.core
(:require [reagent.core :as reagent :refer [atom]]
[datascript :as d]
[cljs-uuid-utils :as uuid]))
(enable-console-print!)
(defn bind
([conn q]
(bind conn q (atom nil)))
@steveklabnik
steveklabnik / distributed-sexism.md
Created January 27, 2014 19:00
"Distributed sexism in a networked world."

Distributed sexism in a networked world

Many words have been written about the systemic, structural nature of oppression. These structures and systems have been documented and discussed at length. But new power structures give rise to new forms of power and control, and therefore oppression. In this paper, I will demonstrate how these new network forms give rise to these new structures, focusing specifically on sexism as a means of furthering male domination. If "the internet" is structured in such a way that "nobody knows if you're a dog," how has the internet reproduced, in modified ways, the existing patriarchal social structures we observe in meatspace?

Galloway posits that networks change the previously centralized nature of sovereignty and power. Communications technologies have enabled such structures to morph from very visible, powerful central forces into fuzzy, distributed, diffuse power. In order for such networked power to accomplish its goals, it needs to modify its tools and tactics to fit t

@jpetazzo
jpetazzo / gist:6127116
Created July 31, 2013 23:21
Debian/Ubuntu containers protips, thanks to @spahl
# this forces dpkg not to call sync() after package extraction and speeds up install
RUN echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup
# we don't need and apt cache in a container
RUN echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active July 20, 2024 05:10
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx