Skip to content

Instantly share code, notes, and snippets.

@mtmckenna
mtmckenna / jsfxr-for-web-audio-api.js
Last active September 3, 2019 18:44
SoundEffect class that wraps jsfxr + uses web audio API instead of the HTML5 audio tag
const AudioContext = window.AudioContext || window.webkitAudioContext;
let context = new AudioContext();
let mute = false;
export default class SoundEffect {
constructor(data) {
this.ended = true;
context.decodeAudioData(jsfxr(data), (buffer) => {
this.buffer = buffer;
});
@mtmckenna
mtmckenna / pizza.html
Created January 28, 2016 06:12
Pizza vs. Memory Leaks Demo
<!DOCTYPE html>
<title>Pizza vs. Memory Leaks</title>
<body>
<style>
body {
background-color: #ffffcc;
color: #000;
font-size: 30px;
text-align: center;
@mtmckenna
mtmckenna / application.controller.js
Last active January 26, 2016 03:59
string array
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
controllerArray: [{ value: 'a'} , {value: 'b'}, {value: 'c'}],
actions: {
updateArray(updatedString, index) {
console.log('updateArray');
console.log(this.get('controllerArray'));
@mtmckenna
mtmckenna / roy.html
Last active January 17, 2016 04:26
memory leak demo
<!DOCTYPE html>
<title>Roy'z Thoughtz</title>
<body style="background-color: #000; color: #fff; background-image: url('orion.jpg'); background-size: 100%;">
<img src="roy.png" style="height: 100px; float: left; padding-right: 10px;">
<div style="font-style: italic; font-size: 30px; height: 100px;" class="roy-quote">
I've seen things...
</div>
export AWS_SECRET_KEY=`cat .aws_secret_key`
ENVIRONMENT=production
ember deploy --environment=$ENVIRONMENT
if [ $? -eq 0 ]
then
LATEST_REVISION="$(ember deploy:list --environment=$ENVIRONMENT | grep "1)" | awk '{print $2}')"
ember deploy:activate --revision=$LATEST_REVISION --environment=$ENVIRONMENT
echo "$(tput setaf 2)Deployed the heck out of the latest revision."
@mtmckenna
mtmckenna / deploy.rb
Last active August 29, 2015 14:20 — forked from twetzel/deploy.rb
Precompile Ember/Rails assets locally during Capistrano deploy
namespace :deploy do
desc 'Compile assets'
task :compile_assets => [:set_rails_env] do
# invoke 'deploy:assets:precompile'
invoke 'deploy:assets:precompile_local'
invoke 'deploy:assets:backup_manifest'
end
namespace :assets do
@mtmckenna
mtmckenna / fatlib.sh
Created December 19, 2011 23:58
Shell script to quickly create a fat library (i.e. a library that works in the simulator and on iOS hardware). To use: Generate a device and simulator build of the static library. From the command line, go to the parent of your static lib products (e.g. /
#!/bin/bash
lipo -output $1 -create ./Release-iphoneos/$1 ./Release-iphonesimulator/$1