Skip to content

Instantly share code, notes, and snippets.


Tom Greuter ludder

View GitHub Profile
Restuta / the-bind-problem.jsx
Last active Mar 22, 2020
React, removeEventListener and bind(this) gotcha
View the-bind-problem.jsx
/* Sometimes it's pretty easy to run ito troubles with React ES6 components.
Consider the following code: */
class EventStub extends Component {
componentDidMount() {
window.addEventListener('resize', this.onResize.bind(this)); //notice .bind
componentWillUnmount() {
window.removeEventListener('resize', this.onResize.bind(this));
irazasyed / Install Composer using MAMP's
Last active Nov 22, 2020
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management
View Install Composer using MAMP's

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management

Instructions to Change PHP Installation

First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php
cowboy / 1.before.js
Created Jun 25, 2012
grunt: an example of building task targets dynamically
View 1.before.js
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
min: {
ariaAccessibility: {
src: ['src/javascripts/jquery.selectBoxIt.ariaAccessibility.js'],
dest: 'src/javascripts/jquery.selectBoxIt.ariaAccessibility.min.js'
dericcrago / gist:1886177
Created Feb 22, 2012
add trailing slash to Backbone.Model urls
View gist:1886177
// example
User = Backbone.Model.extend({
url: function() {
var origUrl =;
return origUrl + (origUrl.charAt(origUrl.length - 1) == '/' ? '' : '/');
addyosmani / details.js
Created Sep 12, 2011 — forked from remy/details.js
Add <details> support - includes stylesheet
View details.js
better details support testing
var isDetailsSupported = (function(doc) {
var el = doc.createElement('details'),
if (!('open' in el)) {
nuxlli /
Created Sep 9, 2011 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
You can’t perform that action at this time.