Skip to content

Instantly share code, notes, and snippets.

@rxwei
rxwei / ad-manifesto.md
Last active December 6, 2024 16:54
First-Class Automatic Differentiation in Swift: A Manifesto
@johnhw
johnhw / umap_sparse.py
Last active May 11, 2025 07:18
1 million prime UMAP layout
### JHW 2018
import numpy as np
import umap
# This code from the excellent module at:
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module
import random
@plembo
plembo / RPIwithQEMU.md
Last active October 9, 2025 02:52
Emulating a Raspberry Pi with QEMU

Emulating a Raspberry Pi with QEMU

Goal: Emulate a Raspberry Pi with QEMU in order to run the Raspbian O/S (based on Debian Linux).

The current setup is not ideal. For one thing, the maximum RAM allowed using the "versatile-pb" firmware is 256 Mb. In addition, only the most basic peripherals, a keyboard and mouse, are supported.

A number of articles have been written on this topic. Most are outdated, and the few recent ones are missing key information.

@epitron
epitron / ean.xml
Last active January 5, 2023 04:03
Oga XML Transform feature
<HotelListResponse xmlns:ns2="http://v3.hotel.wsapi.ean.com/">
<customerSessionId>yuvb3jdpifp2t13y43pass2p</customerSessionId>
<numberOfRoomsRequested>1</numberOfRoomsRequested>
<moreResultsAvailable>false</moreResultsAvailable>
<cacheKey>-48a4e19f:15bec159775:50eb</cacheKey>
<cacheLocation>10.186.170.98:7300</cacheLocation>
<cachedSupplierResponse supplierCacheTolerance="NOT_SUPPORTED" cachedTime="0" supplierRequestNum="98" supplierResponseNum="93" supplierResponseTime="1629" candidatePreptime="28" otherOverheadTime="11" tpidUsed="5220" matchedCurrency="true" matchedLocale="true" />
<HotelList size="2" activePropertyCount="98">
<HotelSummary order="0" ubsScore="0">
<hotelId>139396</hotelId>
@jart
jart / blakefiler.py
Last active October 2, 2024 13:29
Turns bazel query --output=build //tensorflow:libtensorflow_framework.so into isomorphic Makefile
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@Rob--W
Rob--W / README.md
Last active August 8, 2020 03:02
Analysis of WOT 20151208
@avih
avih / equalizer.lua
Last active February 26, 2025 19:12
Visual equalizer script for mpv
--[[
mpv 5-bands equalizer with visual feedback.
Copyright 2016 Avi Halachmi ( https://github.com/avih )
License: public domain
Default config:
- Enter/exit equilizer keys mode: ctrl+e
- Equalizer keys: 2/w control bass ... 6/y control treble, and middles in between
- Toggle equalizer without changing its values: ctrl+E (ctrl+shift+e)

Interactive Machine Learning

Taught by Brad Knox at the MIT Media Lab in 2014. Course website. Lecture and visiting speaker notes.

@havenwood
havenwood / require_relative_with_tco.rb
Last active September 14, 2021 04:22
A #require_relative_with_tco that's like #require_relative but with tail call optimization
module Kernel
def require_relative_with_tco file
absolute_path = File.absolute_path file, __dir__
realpath = File.realpath "#{absolute_path.chomp '.rb'}.rb"
if $LOADED_FEATURES.include? realpath
false
else
RubyVM::InstructionSequence.compile_file(
realpath,
Method Uses Default Accessor Validations Callbacks Touches updated_at Readonly check
update
update_attributes
update_columns
User::update
User::update_all