These rules are adopted from the AngularJS commit conventions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function quadraticBezierAngle(value:Number, anchor1:Point, anchor2:Point, control:Point):Number { | |
var uc:Number = 1 - value; | |
var dx:Number = (uc * control.x + value * anchor2.x) - (uc * anchor1.x + value * control.x); | |
var dy:Number = (uc * control.y + value * anchor2.y) - (uc * anchor1.y + value * control.y); | |
return Math.atan2(dy, dx); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a Promise for loading an image! | |
// Basically taking out the useful, tricky, and heavily refined bit from | |
// http://desandro.github.io/imagesloaded/ | |
function imagePromise( src ){ | |
var deferred = $.Deferred(); | |
var img = new Image(); | |
function resolve(){ | |
// Resolution callbacks receive the image, which you can then inject into the DOM | |
// to avoid triggering an extra HTTP request in IE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Transition helper that allows elements to transition from | |
* scalar sizes (e.g. "2em") to "auto" (or vice versa). This is useful because | |
* browsers either simply do not animate such transitions or do them poorly. | |
* | |
* Requires your CSS to already have the transition defined. This just allows | |
* it to function without much jankiness. | |
* | |
* Usage: | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>video</title> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<style type="text/css"> | |
body { | |
margin: 0; | |
padding: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* How to: | |
* $('div.container').imagesLoaded(function(){console.log('all images loaded in .container');}); | |
* In case you need to support IE8, you need to use HTML5shiv **and** need to modify jQuery the following way: | |
* https://github.com/jquery/jquery/commit/a9533893b9e5e9a248139f5794c5d6099382cf14 | |
*/ | |
(function($){ | |
'use strict'; | |
$.fn.imagesLoaded = (function(){ | |
var imageLoaded = function (img, cb, delay){ |
The following will guide you through the process of enabling SSL on a Apache webserver
- The instructions have been verified with OSX El Capitan (10.11.2) running Apache 2.4.16
- The instructions assume you already have a basic Apache configuration enabled on OSX, if this is not the case feel free to consult Gist: "Enable Apache HTTP server (OSX)"
Create a directory within /etc/apache2/
using Terminal.app: sudo mkdir /etc/apache2/ssl
Next, generate two host keys:
Someone sent me an email asking me what advice I had for new developers. I get this question a bunch, so I wanted to put all my thoughts in one place, that I can update as I get more ideas!
I answered this a bunch on my AMA repo, so here's some initial general answers, before I get to some of the specific questions:
- how to find a project to work on: notwaldorf/ama#33
- how I learn: notwaldorf/ama#32
- what to learn: notwaldorf/ama#51
- advice for your first job: notwaldorf/ama#59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// "four cones" by dave :) | |
int[][] result; | |
float t, c; | |
float ease(float p) { | |
return 3*p*p - 2*p*p*p; | |
} | |
float ease(float p, float g) { |
OlderNewer