Skip to content

Instantly share code, notes, and snippets.

View jaredwilli's full-sized avatar
🏄‍♂️

Jared Williams jaredwilli

🏄‍♂️
View GitHub Profile
@jaredwilli
jaredwilli / gist:1211461
Created September 12, 2011 14:53
Ideas to include in Canvas.js
1. Context method - enables you to restore specific contexts saved throughout the app so that you can pass in a variable that contains it and return the context restoration.
2. renderToCanvas - method that is reusable for doing off-screen rendering of images and slower performing tasks so they can be returned and drawn to the main context easily.
var renderToCanvas = function (width, height, renderFunction) {
var buffer = document.createElement('canvas');
buffer.width = width;
buffer.height = height;
@jaredwilli
jaredwilli / README
Created October 4, 2011 17:05 — forked from joelambert/README
Drop in replacements for setTimeout()/setInterval() that makes use of requestAnimationFrame() where possible for better performance
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
@jaredwilli
jaredwilli / HelloDartTest.dart
Created October 12, 2011 11:50
Dart Compilation
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Simple test program invoked with an option to eagerly
// compile all code that is loaded in the isolate.
// VMOptions=--compile_all
class HelloDartTest {
static testMain() {
print("Hello, Darter!");
@rmurphey
rmurphey / gist:1329222
Last active September 27, 2015 20:47
New computer setup notes

Bootstrap

  • Run software update
  • Download & install XCode in App Store
  • Install Google Chrome and enable syncing -- ensure 3rd party cookies are disabled
  • Install homebrew
  • brew install git
  • brew install wget
  • Copy ssh keys
  • git clone git@github.com:rmurphey/dotfiles.git
@mklabs
mklabs / bash
Created November 1, 2011 21:50
docs simple as cake
#!/bin/bash
# this script install itself (npm package), create a tasks/docs.js, install the docs' task dependencies,
# and run the gh-pages task.
#
# Install:
#
# curl https://raw.github.com/gist/1332036/70f8f3f9b85082569aff7f10773fc40e2fd7388d/bash | sh
#
# It'll generate documentation based on the likely location of
@jaredwilli
jaredwilli / gist:1383333
Created November 21, 2011 17:37 — forked from paulirish/gist:747835
`x || (x = y)` pattern for using an incoming value otherwise using some default
// from https://twitter.com/#!/LeaVerou/status/16613276313980929
// this pattern below is common for using an incoming value otherwise using some default.
/* Bad: */ x = x ? x : y; // simple ternary.
// if x is truthy lets use it.
/* Better: */ x = x || y; // logical OR.
// you could string a bunch of these easily to grab the first non-falsy value:
@mklabs
mklabs / build.js
Created January 2, 2012 22:01
markdown to prez thing
// simple markdown to prez converter
// this uses the really neat impress.js as a presentation framework support.
// slides are delimited by h3 level title.
@lsauer
lsauer / gist:1584308
Created January 9, 2012 18:48
CSS Most important text overflow and wrapping options
/*lo sauer
See also http://www.w3schools.com/cssref/
*/
#myElId tr>:nth-child(3){
/*
overflow-x | overflow-y | overflow
*/
overflow:visible|hidden|scroll|auto|inherit;
/*
@ToddG
ToddG / khan-academy-video.json
Created February 10, 2012 02:05
Khan Academy Video Feed v2
{
"author": "Todd Greenwood-Geer",
"categories": [
{
"name": "Geometry",
"videos": [
{
"desc": "introduction-to-angles",
"id": "2439OIVBgPg",
"title": "Introduction to angles",
@jaredwilli
jaredwilli / global-variables-are-bad.js
Created February 22, 2012 18:02 — forked from hallettj/global-variables-are-bad.js
How and why to avoid global variables in JavaScript
// It is important to declare your variables.
(function() {
var foo = 'Hello, world!';
print(foo); //=> Hello, world!
})();
// Because if you don't, the become global variables.
(function() {