Skip to content

Instantly share code, notes, and snippets.

Avatar

Tom Greuter ludder

View GitHub Profile
@Restuta
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
irazasyed / Install Composer using MAMP's PHP.md
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 PHP.md

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
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.
grunt.initConfig({
min: {
ariaAccessibility: {
src: ['src/javascripts/jquery.selectBoxIt.ariaAccessibility.js'],
dest: 'src/javascripts/jquery.selectBoxIt.ariaAccessibility.min.js'
},
@dericcrago
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 = Backbone.Model.prototype.url.call(this);
return origUrl + (origUrl.charAt(origUrl.length - 1) == '/' ? '' : '/');
}
});
@addyosmani
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'),
fake,
root,
diff;
if (!('open' in el)) {
@nuxlli
nuxlli / sublime_text_2_useful_shortcuts.md
Created Sep 9, 2011 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts
View sublime_text_2_useful_shortcuts.md

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • 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.