Skip to content

Instantly share code, notes, and snippets.

View thoov's full-sized avatar
🤔
Is the Kool-Aid man the glass part or the liquid?

Travis Hoover thoov

🤔
Is the Kool-Aid man the glass part or the liquid?
View GitHub Profile
@thoov
thoov / js_invocation_types.js
Last active December 17, 2015 11:39
Javascript Invocation Types
/*
There are four patterns of invocation in JavaScript:
- the method invocation pattern
- the function invocation pattern
- the constructor invocation pattern
- the apply invocation pattern
The patterns differ in how the bonus parameter this is initialized.
import Ember from 'ember';
import stateFor from 'ember-state-services/state-for';
export default Ember.Controller.extend({
data: stateFor('todos', 'model')
});
@thoov
thoov / flatten.php
Created November 8, 2011 07:48
Flatten and Inflate n-dimensional arrays in php.
<?php
private function flatten($array, $base = "", $div_char = "/")
{
$ret = array();
if(is_array($array))
{
foreach($array as $k => $v)
{
if(is_array($v))
@thoov
thoov / application.hbs
Last active August 29, 2015 14:24
Ember Table built with compossible components. https://github.com/emberjs/ember.js/issues/11124
{{#my-table model=arrayOfData as |table|}}
{{#my-column table=table header='FirstName'}}
{{firstName}}
{{/my-column}}
{{#my-column table=table header='LastName'}}
{{lastName}}
{{/my-column}}