Skip to content

Instantly share code, notes, and snippets.

{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
module DiagramsTidal where
import Sound.Tidal.Pattern hiding (square)
import Sound.Tidal.Time
import Sound.Tidal.Utils
@chadochan
chadochan / PolyCalc.sc
Last active May 26, 2017 05:01
SuperCollider implementation of Andrew Mead's polyrhythm format calculator (for details http://bit.ly/1PSYIjS). Returns the possible formats for two polyrhythmic limbs.
PolyCalc {
*new { |limb1 = 21, limb2 = 25|
var limb1factors = limb1.factors;
var limb2factors = limb2.factors;
var limb1FirstFactor, limb1SecondFactor, limb2FirstFactor, limb2SecondFactor, temp;
var formatDurations;
if(limb1factors.size == 1, { limb1factors.add(1) });
if(limb2factors.size == 1, { limb2factors.add(1) });
@mariocesar
mariocesar / admin.py
Last active December 28, 2023 19:17
Django admin decorator to create a confirmation form action, like the default delete action works
from .models import Post, Category
from .decorators import action_form
class PostCategoryForm(forms.Form):
title = 'Update category for the selected posts'
myfile = forms.FileField()
category = forms.ModelChoiceField(queryset=Category.objects.all())
@pierinz
pierinz / prepare.sh
Last active June 11, 2017 08:04
Minimal Raspbian & SD enhancements for CitofonoWeb
#!/bin/bash
set -e
echo "Choose root password:"
passwd
mkdir -p /root/.ssh/
#You may want to add some authorized keys
#echo "$key" > /root/.ssh/authorized_keys
@0XDE57
0XDE57 / config.md
Last active May 25, 2024 03:32
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable. I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere No longer required: Enable HTTPS-Only Mode, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@ohanhi
ohanhi / frp.md
Last active May 6, 2024 05:17
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

@ALOUT
ALOUT / amenGlitches.scd
Created June 1, 2014 11:40
amen Glitchテンプレート
// @phrontist
// https://soundcloud.com/phrontist/lazy-amen-break-glitches
s.reboot;
s.stop;
~amen = Buffer.readChannel(s,"/Applications/SuperCollider/sounds/fools_gold.wav", channels:[0,0]);
SynthDef(\loop, {| out = 0, bufnum = 0, gate = 1, pos = 0, speed = 1, freq = 0, endfreq = 0.001, sustain, wobble = 1, boost = 1|
@yitsushi
yitsushi / EventSystem.js
Created May 6, 2014 09:52
EventSystem that I use with React.js to communicate between components
var EventSystem = (function() {
var self = this;
self.queue = {};
return {
publish: function (event, data) {
var queue = self.queue[event];
if (typeof queue === 'undefined') {
@Akkiesoft
Akkiesoft / minimal-raspbian2-X.sh
Last active May 20, 2018 07:20
コンパクトなRaspbianを作るやつをベースに自己流にアレンジしたもの。RaspbianがXありで1.2GBちょいのディストリに変身します。NOOBS1.3.4のRaspbianに対応。
#/bin/bash
# コンパクトなRaspbianを作るやつをベースに自己流にアレンジしたもの
# Xもいらないバージョン: https://gist.github.com/Akkiesoft/9873563
#
# ベース: http://www.cnx-software.com/2012/07/31/84-mb-minimal-raspbian-armhf-image-for-raspberry-pi/
# 前のバージョン: https://gist.github.com/Akkiesoft/5426660
sudo apt-get update
rm -rf python_games ocr_pi.png
@XVilka
XVilka / TrueColour.md
Last active April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!