Skip to content

Instantly share code, notes, and snippets.

##Create an alias to MAMP's PHP installation

To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

Within the terminal, run:

nano ~/.bash_profile

This will open nano with the contents, at the top in a blank line add the following line:

@jdeagle
jdeagle / index.js
Created November 28, 2014 18:03
requirebin sketch
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
var Router = require('routes');
var router = Router();
var callback = function () {
console.log("woot");
};
@jdeagle
jdeagle / SassMeister-input-HTML.html
Created January 7, 2015 14:42
Generated by SassMeister.com.
<section>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
@jdeagle
jdeagle / All-Shape-Types.markdown
Created January 16, 2015 21:58
All Shape Types
var VirtualScroll = function() {
var vs = {};
var numListeners, listeners = [], initialized = false;
var touchStartX, touchStartY;
// [ These settings can be customized with the options() function below ]
@jdeagle
jdeagle / gist:462d92cfcc29c7d2db6c
Last active August 29, 2015 14:18
OSX install mcrypt
http://stackoverflow.com/questions/9343151/where-is-php-ini-in-mac-os-x-lion-thought-it-was-in-usr-local-php5-lib
Answers from @Cronk and @Justin got me close on Mac OS X 10.9 Mavericks. In fact, on my system the /etc/php.ini file was missing completely, and it wasn't until I ran phpinfo() on the web server that I observed there was no configuration file. Copying the file from /etc/php.ini.default and adding the fully qualified path to the mcrypt.so library to the config file solved the problem:
cp /etc/php.ini.default /etc/php.ini
Then in /etc/php.ini add the following line (using the correct path to your mcrypt.so file):
extension="/usr/local/Cellar/php54-mcrypt/5.4.29/mcrypt.so"
Then restart Apache2:
@jdeagle
jdeagle / gist:34e0f53d1c8bdb7d58c8
Created May 11, 2015 14:11
Change permissions for NPM node modules
sudo chown -R $USER ~/.npm
sudo chown -R $USER /usr/local/lib/node_modules
@jdeagle
jdeagle / SVGPath.js
Created June 5, 2015 16:06
SVG Path example
var TweenLite = require("TweenLite");
var proxy = {};
function getSize(ratio, total) {
return total * ratio;
}
function getProps(el, values) {

If you are using backbone (and backbone.marionette) in a browserify managed project, you will likely run into issues with underscore (at least if you manage your dependencies with npm). Each package, that has underscore as a dependency, will require its own version of underscore (making your bundle file contain multiple versions of underscore). Back in the days, you could shim backbone and underscore like:

browserify({
	shim: {
		'underscore': {
			path: './node_modules/underscore/underscore.js',
			exports: '_'
 },
@jdeagle
jdeagle / getTemplate.php
Created July 9, 2015 18:33
Query dependant timber rendering
class InspirationModule
{
public $template;
public $query;
public $vars;
}
$moduleA = new InspirationModule();