Skip to content

Instantly share code, notes, and snippets.

@jaredly
jaredly / PianoMerge.qml
Created March 27, 2022 16:06
Here's a plugin to merge several voices into a single piano part
import QtQuick 2.0
import MuseScore 3.0
MuseScore {
menuPath: "Plugins.pluginName"
description: "Description goes here"
version: "1.0"
onRun: {
var loops = 0
@jaredly
jaredly / missing-deps-to-local.js
Last active September 27, 2021 18:33
A nice little script for converting gradle dependencies from some external source (ahem jcenter) to a local maven repository.
// Based on info from this post https://brightinventions.pl/blog/migrating-away-from-bintray-jcenter-when-there-is-no-alternative-repository/#setting-up-a-local-maven-repository
/**
* How to use this tool:
* 1. comment out `jcenter()` in your build.gradle
* 2. run `./gradlew :app:dependencies > deps.log`
* 3. mkdir `local-maven`
* 4. add `maven { url = uri("${rootProject.projectDir}/local-maven") }`
* right before the commented-out `jcenter()` calls in your build.gradle.
* 5. run `node missing-deps-to-local.js ./local-maven < deps.log`
@jaredly
jaredly / spirals.jd
Last active September 5, 2021 17:48
@ffi("Vec2") type Vec2#08f7c2ac = {
x: float#builtin,
y: float#builtin,
};
@ffi("End") type End#830ad468 = {};
@ffi("Start") type Start#098d99e8 = {};
@ffi("Center") type Center#1189540a = {};
(defn code-mirror
"Create a code-mirror editor. The parameters:
value-atom (reagent atom)
when this changes, the editor will update to reflect it.
options
:style (reagent style map)
will be applied to the container element
:js-cm-opts
options passed into the CodeMirror constructor
:on-cm-init (fn [cm] -> nil)
@jaredly
jaredly / inner.html
Created February 2, 2015 16:43
Demonstrate react devtools from inner frame
<script>
__REACT_DEVTOOLS_GLOBAL_HOOK__ = parent.__REACT_DEVTOOLS_GLOBAL_HOOK__
</script>
<script src="vendor.js"></script>
<script>
window.React = parent.React = require('react')
window.onload = function() {
React.render(React.createElement('strong', null, 'hello'), document.body)
}
</script>
// @flow
import {Component, type Node} from 'react'
import authenticatedApolloClient from '../shared/authenticatedApolloClient';
/**
* Example usage:
*
* const ScreenWithLoader = (props) => <ApolloWrapper
* queryOptions={{
@jaredly
jaredly / abilities-in-scheme.scm
Last active January 28, 2021 03:32
This is able to at least handle the "jump between two handlers" aspect of abilities. will see how well I make it through the rest of the test cases. This is run using chicken scheme.
(define stack '())
(define (throw-effect k effect)
(let* ((handler (car stack)) (name (car handler)) (fn (cadr handler)))
(set! stack (cdr stack))
(print "Calling " name)
(fn (cons 'effect (cons k effect)))
)
)
@jaredly
jaredly / App.re
Last active January 1, 2021 17:34
ReasonReact Context API Example
module StringContext =
Context.MakePair({
type t = string;
let defaultValue = "Awesome";
});
let component = ReasonReact.statelessComponent("Tree");
let make = _children => {

All the docs probably

base..

.> view base..

  (base..) : (b ->{𝕖} c) -> (a ->{𝕖} b) -> a ->{𝕖} c
  (base..) f g x = f (g x)
@jaredly
jaredly / neovim.svg
Created February 25, 2014 17:26
A few concepts for a NeoVim logo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.