Skip to content

Instantly share code, notes, and snippets.

@andorx
andorx / event-delegate.js
Created October 16, 2018 07:11 — forked from gordonbrander/event-delegate.js
addEventDelegate() - easy event delegation
// Copyright 2018 Gordon Brander
// Released under MIT License https://opensource.org/licenses/MIT
const closest = (el, selector) =>
el.closest ? el.closest(selector) : null;
/**
* Delegate event handling to a parent element.
* @arg {Element} el - the parent element that we will be delegating handling to.
* @arg {string} selector - CSS selector of elements that should receive events.
@andorx
andorx / sass-7-1-pattern.scss
Created October 10, 2018 07:49 — forked from rveitch/sass-7-1-pattern.scss
Sass 7-1 Pattern
sass/
|
|– base/
| |– _reset.scss # Reset/normalize
| |– _typography.scss # Typography rules
| ... # Etc…
|
|– components/
| |– _buttons.scss # Buttons
| |– _carousel.scss # Carousel
@andorx
andorx / comment-example.js
Created July 4, 2018 08:01 — forked from brandongoode/comment-example.js
Dynamoose range and hash key example
var commentSchema = new Schema({
postId: {
type: String,
hashKey: true
},
id: {
type: String,
rangeKey: true,
default: shortId.generate
@andorx
andorx / happy_git_on_osx.md
Created March 3, 2016 12:47 — forked from trey/happy_git_on_osx.md
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@andorx
andorx / .jscsrc
Last active August 29, 2015 14:16
{
"preset": "google",
"fileExtensions": [ ".js", "jscs" ],
"requireParenthesesAroundIIFE": true,
"requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties",
"maximumLineLength": 120,
"validateLineBreaks": "LF",
"validateIndentation": 2,
{
"globals": {
"assert" : true,
"define" : true,
"require" : true,
"module" : true,
"exports" : true,
"$" : true,
"jQuery" : true,
"_" : true,
<?php
class Curl {
/**
* cURL request method
*
* @var string
*/
protected $_method = 'GET';
<?php
/**
* @author Simon Holywell <treffynnon@php.net>
*/
class LazyLoadingProxy {
/**
* Where the instance of the actual class is stored.
* @var $instance object
*/
private $instance = null;