Skip to content

Instantly share code, notes, and snippets.

View jamcoupe's full-sized avatar

Jamie Couperwhite jamcoupe

View GitHub Profile
@jonleighton
jonleighton / base64ArrayBuffer.js
Last active April 19, 2024 21:54
Encode an ArrayBuffer as a base64 string
// Converts an ArrayBuffer directly to base64, without any intermediate 'convert to string then
// use window.btoa' step. According to my tests, this appears to be a faster approach:
// http://jsperf.com/encoding-xhr-image-data/5
/*
MIT LICENSE
Copyright 2011 Jon Leighton
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@aholachek
aholachek / README.md
Last active September 23, 2023 20:51
Calendar Day View Layout

##D3 Calendar Day View Layout

This script demonstrates a layout algorithm I developed for a day calendar view. The height and y-axis placement of each calendar item are solely determined by its start and end times, but the width and x-axis placement of each item is dependent on how many other items occur during the same time as it.

You can change the layout by adding items using the form to the left, or clicking on items to remove them.

###There are three main steps for the layout calculation: