Skip to content

Instantly share code, notes, and snippets.

@transat
transat / SharedObjectTest.swift
Last active March 29, 2021 02:56
SharedObject
//: [Previous](@previous)
import SwiftUI
import PlaygroundSupport
public struct Metadata: Codable {
var name: String
var int: Int
var bool: Bool
init(){
@transat
transat / Gravitational Field.markdown
Created March 20, 2016 05:32
Gravitational Field

Gravitational Field

Particles in a gravitational field, randomly inverting charge to create interesting behaviors. Uses sketch.js to manage the 2d context and power animation.

A Pen by Justin Windle on CodePen.

License.

@transat
transat / [Autoplaying Audio] Playing with Web Audio & Canvas .markdown
Created March 19, 2016 14:24
[Autoplaying Audio] Playing with Web Audio & Canvas

[Autoplaying Audio] Playing with Web Audio & Canvas

I was working on an audio visualization animation at work and discovered the amazing, yet scary, Web Audio API for such a purpose.

I made this visualization with an inaccurate IE fallback that inserts an audio element on the page and generates a random waveform as the sound plays. There is also an event listener to play the default sound and animation on iOS devices that don't allow autoplay onload.

I took what I learned from that and made a simple demo. A full write-up should be published in the near future.

A Pen by Nick Hehr on CodePen.

@transat
transat / Snow + Audio Experiment.markdown
Created March 19, 2016 14:14
Snow + Audio Experiment
@transat
transat / Three.JS Audio Visualization.markdown
Created March 19, 2016 14:10
Three.JS Audio Visualization
@transat
transat / .bashrc
Last active June 24, 2021 13:30
Nice Git-friendly bash prompt with Monokai colours and different output for command and output. READ the included instructions if you want this to look as it should!
# WEDISAGREE terminal prompt. By Clem.
# Change the 16 colours of your default terminal palette to the following Monokai-inspired colours. Do this in your terminal's profile preferences.
# 1st 8 colours: #1D1F21, #F92672, #A6E22E, #FD971F, #1E90FF, #9458FF, #66D9EF, #EDD400
# Next 8 colours: #B294BB, #CC6666, #F92672, #DE935F, #1E90FF, #74B933, #4277AD, #FFFFFF
# Make sure your background colour is the same as the first colour of your palette: #1D1F21
# And set your text colour to #B694D3 and your bold colour to #DA6234