This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* PHP port of https://github.com/JedWatson/classnames | |
* | |
* Examples: | |
* <code> | |
* classnames('foo', 'bar'); // "foo bar" | |
* classnames('foo', ['bar' => true]); // "foo bar" | |
* classnames(['foo-bar' => true]); // "foo-bar" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.fn.dataBind = function (bindings) { | |
if (this.length) { | |
var pairs = []; | |
for (var name in bindings) { | |
if (bindings.hasOwnProperty(name)) { | |
pairs.push(name + ': ' + bindings[name]); | |
} | |
} | |
this.attr('data-bind', pairs.join(', ')); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Show a status bar in the console. | |
* | |
* <code> | |
* for ($x = 1; $x <= 100; ++$x) { | |
* show_status($x, 100); | |
* usleep(100000); | |
* } | |
* </code> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import EmberRouter from '@ember/routing/router'; | |
import config from './config/environment'; | |
const Router = EmberRouter.extend({ | |
location: 'none', | |
rootURL: config.rootURL | |
}); | |
Router.map(function() { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import isEmpty from 'lodash/isEmpty'; | |
/* import isValidObjectId from 'Utils/isValidObjectId'; */ | |
/* import matchByIdOr from 'Utils/matchByIdOr'; */ | |
/** | |
* Assumes you are using Mongoose. | |
*/ | |
export default class CrudRepository | |
{ | |
#ModelClass; |
OlderNewer