Skip to content

Instantly share code, notes, and snippets.

View tkroo's full-sized avatar
🐱

David Sullivan tkroo

🐱
View GitHub Profile
@todbot
todbot / wavetable_synthio_synth.py
Last active November 15, 2023 21:21
Demonstrate new synthio.Synthesizer as wavetable MIDI synth in CircuitPython
#
# wavetable_synthio_synth.py -- Demonstrate new synthio.Synthesizer as wavetable MIDI synth
# 15 Apr 2023 - @todbot / Tod Kurt
# video demo: https://www.youtube.com/watch?v=uUnS3nR2K-8
#
# Hooked up to generic I2S DAC
# Uses two pots:
# knobA - selects the base wave
# knobB - selects the mix between base wave and next wave
#
@xdesro
xdesro / .eleventy.js
Created October 27, 2022 19:44
Hint VS Code for eleventyConfig autocompletion.
/**
* @param {import("@11ty/eleventy/src/UserConfig")} eleventyConfig
*/
module.exports = (eleventyConfig) => {
return {};
};
Array.from(document.styleSheets).filter((sheet) => { try { sheet.cssRules; return true; } catch (err) { console.log(`Due to CORS issues, this script can't access "${sheet.href}"`); return false; }}).map((sheet) => Array.from(sheet.cssRules).map((rule) => rule.type === rule.FONT_FACE_RULE ? rule.cssText : rule.type === rule.STYLE_RULE ? Array.from(document.querySelectorAll(rule.selectorText)).some((node) => node.getBoundingClientRect().top < window.innerHeight && window.getComputedStyle(node).display !== 'none') ? rule.cssText : null : rule.type === rule.MEDIA_RULE ? `@media ${rule.conditionText} {${Array.from(rule.cssRules).map((mediaRule) => mediaRule.type === mediaRule.FONT_FACE_RULE ? mediaRule.cssText : mediaRule.type === mediaRule.STYLE_RULE ? Array.from(document.querySelectorAll(mediaRule.selectorText)).some((node) => node.getBoundingClientRect().top < window.innerHeight && window.getComputedStyle(node).display !== 'none') ? mediaRule.cssText : null : null).filter((mediaRule) => mediaRule != null).join(
@agermanidis
agermanidis / resize_many.sh
Last active May 30, 2021 21:57
bash script to resize an image to multiple sizes with one command using ImageMagick
#!/bin/bash
# Usage: ./resize_many.sh <filename> <sizes...>
# e.g. ./resize_many.sh myasset.png 10x10 20x20 30x30
# produces 3 files, myasset10x10.png myasset20x20.png myasset30x30.png
fullname=$1
shift;
sizes=$*
extension="${fullname##*.}"
@paulmsmith
paulmsmith / keymap.cson
Created January 28, 2016 12:29
emmet + nunjucks in atom with snippets
'atom-text-editor[data-grammar="text html nunjucks"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'
'atom-text-editor[data-grammar="source nunjucks"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'
#https://github.com/atom/autocomplete-plus/issues/86#issuecomment-82661027
'atom-text-editor.autocomplete-active:not([mini])':
'tab': 'autocomplete-plus:confirm'
@magicoli
magicoli / copy-from-time-machine.sh
Last active April 18, 2023 19:31 — forked from vjt/copy-from-time-machine.sh
Copy data from a Time Machine volume mounted on a Linux box.
#!/bin/bash
#
# Copy data from a Time Machine volume mounted on a Linux box.
#
# Usage: copy-from-time-machine.sh <source> <target>
#
# source: the source directory inside a time machine backup
# target: the target directory in which to copy the reconstructed
# directory trees. Created if it does not exists.
#
@carolineschnapp
carolineschnapp / gist:9122054
Last active March 7, 2024 08:53
Order form to use in a page or collection template.
{% comment %}
Source: https://gist.github.com/carolineschnapp/9122054
If you are not on a collection page, do define which collection to use in the order form.
Use the following assign statement, replace 'your-collection-handle-here' with your collection handle.
{% assign collection = collections.your-collection-handle-here %}
Use the assign statement outside of this comment block at the top of your template.
{% endcomment %}
{% paginate collection.products by 100 %}
@sstarr
sstarr / gist:506478
Created August 3, 2010 14:36
Tumblr only allows a maximum width of 500px for embedded YouTube videos. Paste this script into your theme, change contentWidth and the embed code will be updated accordingly.
<!-- Widescreen YouTube Embeds by Matthew Buchanan & Hayden Hunter
http://matthewbuchanan.name/451892574
http://blog.haydenhunter.me
Hacked around by Simon Starr to break out of Tumblr's max width of 500px
http://www.simonstarr.com
Original source here: http://pastie.org/871790
Released under a Creative Commons attribution license: