Skip to content

Instantly share code, notes, and snippets.

View juliancheal's full-sized avatar

Julian Cheal juliancheal

View GitHub Profile
@watson
watson / airplay.md
Last active November 5, 2024 23:27
An overview over my AirPlay related modules
@kindohm
kindohm / breaks.rb
Last active August 22, 2021 16:08
Sonic Pi Breaks
# mashing up breakbeats in Sonic Pi
# resulting audio: https://soundcloud.com/kindohm/sonic-pi-breaks
# this var changes the playback speed of the breaks,
# which in turn controls the loop sleep time and overall tempo
rate = 1
# samples paths
samples = []
samples.push("C:\\tidal-samples\\samples\\akuma\\Half Baked break a.wav")
class Robot
def say(msg)
`say "#{msg}"`
self
end
def beep
say "beep boop bling beep bee"
end
@josephg
josephg / 0dedict.py
Last active February 20, 2025 03:12
Apple dictionaries
# Thanks to commenters for providing the base of this much nicer implementation!
# Save and run with $ python 0dedict.py
# You may need to hunt down the dictionary files yourself and change the awful path string below.
# This works for me on MacOS 10.14 Mohave
from struct import unpack
from zlib import decompress
import re
filename = '/System/Library/Assets/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/9f5862030e8f00af171924ebbc23ebfd6e91af78.asset/AssetData/Oxford Dictionary of English.dictionary/Contents/Resources/Body.data'
f = open(filename, 'rb')
@csexton
csexton / radbeacon-flasher
Last active August 29, 2015 14:17
Flasher Script for RadBeacon USB
#!/usr/bin/env ruby
#
# radbeacon-flasher
#
# USAGE
#
# On a mac you should not need to pass any options in to flash the default
# firmware to the beacon. The firmware will be automatically downloaded. Use
# the `-w` option to "watch" for the beacon to be plugged in and continue
# flashing beacon.
@hsiboy
hsiboy / FastLED_DMX.ino
Created March 2, 2015 16:37
DMX control of neopixels, WS2811, WS2812 etc using FastLED Arduino Teensy3.1
#include <DmxReceiver.h>
#include <FastLED.h>
#define DMX_NUM_CHANNELS 15
#define NUM_LEDS 15
#define DATA_PIN 11
#define LED_TYPE WS2811
#define COLOUR_ORDER
#define CLOCK_PIN 13 // Clock pin only needed for SPI based chipsets when not using hardware SPI
#Tribute to Dr Who coded by Robin Newman, February 2015
#Better on a Pi2 or Mac. A bit scratchy on B+ but just about OK
use_synth :prophet #synth for bass part
s=0 #to set the scope of the variable redefined in the next function
define :usebpm do |n| #setup own bpm definition
s=1.0/8*120/n
end
usebpm(200) #set required bpm
@holman
holman / emoji_test.rb
Last active June 18, 2020 01:27
A snapshot of the tests we use internally at GitHub to help edit our blog posts before they go out to everybody. For more information, take a peek at http://zachholman.com/posts/how-github-writes-blog-posts
require_relative "test_helper"
require "open-uri"
require "net/http"
class EmojiTest < Blog::Test
def test_no_emoji
posts.each do |post|
content = File.read(post)
refute_match /:[a-zA-Z0-9_]+:/, content,
@brianburridge
brianburridge / gist:8d2755a73dd5b4f0332b
Created December 10, 2014 19:47
Export local db to JSON
namespace :json do
desc "Export all data to JSON files"
task :export => :environment do
Rails.application.eager_load!
ActiveRecord::Base.descendants.each do |model|
file = File.open(File.join(Rails.root, "db", "export", "#{model.table_name}.json"), 'w')
file.write model.all.to_json
file.close
end

Drop the following script into your path somewhere, I keep it in ~/bin.

Then add a git alias for bro

git config --global alias.bro !git-browse