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}]
@nberger
nberger / reagent_infinite_scroll.cljs
Last active May 6, 2024 16:15
Reagent infinite scroll
(ns views.infinite-scroll
(:require
[reagent.core :as r]))
(defn- get-scroll-top []
(if (exists? (.-pageYOffset js/window))
(.-pageYOffset js/window)
(.-scrollTop (or (.-documentElement js/document)
(.-parentNode (.-body js/document))
(.-body js/document)))))
@GMMan
GMMan / S90overclock
Created January 25, 2021 20:25
Overclock script for Densha de Go! Plug & Play
#!/bin/sh -e
start() {
cat "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq" > "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"
cat "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq" > "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"
}
stop() {
cat "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_boot_freq" > "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"
cat "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_boot_freq" > "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"
@coryodaniel
coryodaniel / list.txt
Created May 13, 2020 22:04
GCP List of API Services
NAME TITLE
abusiveexperiencereport.googleapis.com Abusive Experience Report API
acceleratedmobilepageurl.googleapis.com Accelerated Mobile Pages (AMP) URL API
accessapproval.googleapis.com Access Approval API
accesscontextmanager.googleapis.com Access Context Manager API
actions.googleapis.com Actions API
adexchangebuyer-json.googleapis.com Ad Exchange Buyer API
adexchangebuyer.googleapis.com Ad Exchange Buyer API II
adexchangeseller.googleapis.com Ad Exchange Seller API
adexperiencereport.googleapis.com Ad Experience Report API
#from http://www.pyimagesearch.com/2015/03/30/accessing-the-raspberry-pi-camera-with-opencv-and-python/
# import the necessary packages
from picamera.array import PiRGBArray
from picamera import PiCamera
import time
import cv2
# initialize the camera and grab a reference to the raw camera capture
camera = PiCamera()
@Speedy37
Speedy37 / gpg-agent-relay.sh
Created July 10, 2020 11:02
WSL2 gpg agent relay (Yubikey)
#!/bin/bash
# Launches socat+npiperelay to relay the gpg-agent socket file for use in WSL
# See https://justyn.io/blog/using-a-yubikey-for-gpg-in-windows-10-wsl-windows-subsystem-for-linux/ for details
GPGDIR="${HOME}/.gnupg"
USERNAME=Vincent
# I use the same username for wsl and windows, but feel free to modify the paths below if that isn't the case
WIN_GPGDIR="C:/Users/${USERNAME}/AppData/Roaming/gnupg"
NPIPERELAY="${HOME}/npiperelay.exe"
@veekaybee
veekaybee / normcore-llm.md
Last active May 6, 2024 16:10
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@atoponce
atoponce / word-lists.md
Last active May 6, 2024 16:06
A list of notable and primarily English word lists that can be used for building passphrases.

Passphrase Word Lists

Introduction

This document outlines a number of different word lists for passphrase generation, encoding of binary data, and other uses. This document is grouped and sorted by the number of unique words in each word list, fewest unique words first.

Licensing Note

Some of these word lists are placed in the public domain, others are copyrighted with various licenses. Please refer to the license of each word

@pmac
pmac / ring-videos-download.py
Created October 30, 2018 00:16
Download all the videos between two events from Ring
# https://github.com/tchellomello/python-ring-doorbell
from ring_doorbell import Ring
# ID of the newest video you want
OLDER_THAN = 6589184120805222376
# ID of the oldest video you want
LAST_ONE = 6587337941997938664
# grab info on this many videos at a time
CHUNK_SIZE = 50
@fnky
fnky / ANSI.md
Last active May 6, 2024 16:06
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27