Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tekin
tekin / .gitattributes
Last active February 23, 2024 16:46
An example .gitattributes file that will configure custom hunk header patterns for some common languages and file formats. See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details.
# Stick this in your home directory and point your Global Git config at it by running:
#
# $ git config --global core.attributesfile ~/.gitattributes
#
# See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details
*.c diff=cpp
*.h diff=cpp
*.c++ diff=cpp
*.h++ diff=cpp
@fhunleth
fhunleth / ble.md
Last active December 7, 2023 19:55
Bluetooth with Nerves notes

UPDATE: THIS WAS WRITTEN BEFORE BlueHeron EXISTED

This is a braindump of my progress over the weekend to look into Bluetooth support on Nerves. While Bluetooth has a lot of specs, supporting a subset of BLE that makes it easy for Nerves devices to communicate with cell phones and back would be generally useful.

There are two options for BLE support on Nerves:

  1. Make a custom Nerves system that uses bluez
  2. Use Harald

Phoenix 1.4.x to 1.5.0 upgrade instructions

Phoenix 1.5 requires Elixir >= 1.7. Be sure your existing version is up to date by running elixir -v on the command line.

Install the new phx.new project generator

$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new 1.5.0
@jarmitage
jarmitage / avril.tidal
Created April 14, 2020 20:37
Avril 14th
-- happy avril 14th :)))))))))))))))))))))))))))))))))))))))
do
let bars = 4
key = "8"
righthand = "[[4 -3] [0 _ _ _ _ _ 0]] [[-3, -8] [7 5 4 0]]"
lefthand = "[0 9 12 16] [4 12 16 19] [5 12 17 19] [2 12 17 16]"
d1 $ slow bars
$ stack [
n (righthand + key + "<24 36>/2"),
defmodule Test do
def thing() do
1+1
end
defmacro my_macro do
quote do
1 + 1
end
end
@maximecb
maximecb / music.csv
Created May 19, 2018 17:21
Python program to sequence MIDI music using a CSV spreadsheet
X kick snare
X
X
X
X kick
X
X
X
X kick snare clap
X
@jpbecotte
jpbecotte / Vue-cli-3-Phoenix-1.3-HOWTO.md
Last active August 23, 2020 05:32
Vue-cli 3, Phoenix 1.3, a complete how-to

Introduction

I have been struggling to start a new project with Phoenix 1.3 and the new vue-cli 3 for Vue.js. There are tons of example already but none of them suited my needs, because:

  • I want to use the new Vue-cli to select the features that I want,
  • I do NOT want to setup Webpack (I know, what a shame!). The new Vue-cli includes the new vue-cli-service, which uses an instance of webpack-dev-server, so you don't have to import it manually in your project.
  • I do not want to use Brunch.

Create your Phoenix App

Assuming that you have Elixir and Phoenix 1.3 are both installed, let's build our new App.

@rbnpi
rbnpi / ps3.py
Last active November 2, 2020 00:15
Control Sonic PI 3 from a wireless PS3 games controller See video at https://youtu.be/8HcHKyhZaSM
#!/usr/bin/env python3
#ps3 wireless controller interface by Robin Newman July 2017
#converts controller inputs to OSC messages
#which can be output to Sonic Pi 3, running on the local computer, or on an external machine
#rtested with ps3 "afterglow" wireless controller, dongle in Pi usb socket
#needs sudo apt-get install joystick after sudo apt-get update
#also needs sudo pip3 install python-osc
#Version 2. Modified to ensure clean exit on Ubuntu
import subprocess,pygame,sys
@endolith
endolith / chords.md
Last active June 9, 2021 04:31
List of chords in just intonation

Wikipedia's List of pitch intervals is great, but I can't find a single comprehensive list of just intonation triads/chord names anywhere, so I'll start making my own.

These are copied from Wikipedia or wherever. No guarantees of accuracy.

Several triads are illustrated in my consonance map.

Triads

2:3:4     power chord / fifth chord

3:5:7 "major triad of the Bohlen–Pierce scale"