Skip to content

Instantly share code, notes, and snippets.

View benbabics's full-sized avatar

Ben Babics benbabics

View GitHub Profile
@Component({
selector: 'app-month-range-selector-dialog',
template: `
<ng-template #foo let-value="value" let-column="column" ngx-datatable-cell-template>
<div class="flex flex-column">
Foo: {{ value }}
</div>
</ng-template>
<ng-template #bar let-value="value" let-column="column" ngx-datatable-cell-template>
@benbabics
benbabics / company.json
Last active September 14, 2021 14:16
PRS Ngx-DataTables
[
{
"name": "Ethel Price",
"gender": "female",
"company": "Johnson, Johnson and Partners, LLC CMP DDC",
"age": 22
},
{
"name": "Claudine Neal",
"gender": "female",
@benbabics
benbabics / example.js
Created June 2, 2019 21:53
teaching bob basic programmings
var phrase = "I <3 Bob";
var bob = {
id: 51,
name: "Bob"
}
var ben = {
id: 38,
name: "Ben"
}
@benbabics
benbabics / route-test.js
Created September 13, 2016 00:04
Ember Mock Service
import Ember from 'ember';
import { moduleFor, test } from 'ember-qunit';
let mockSession = Ember.Service.extend({
isAuthenticated: true,
currentUser: Ember.computed('isAuthenticated', function() {
return Ember.RSVP.Promise(function(resolve) {
resolve( Ember.Object.create({ accounts: [] }) );
});
})
@benbabics
benbabics / docker-compose.yaml
Created May 24, 2017 22:45
sherpa docker-compose setup
version: '2'
services:
### Applications Code Container #############################
applications:
image: tianon/true
volumes:
- ${APPLICATION}:/var/www
@benbabics
benbabics / Part One
Created May 2, 2017 17:59
Exception thrown locally while registering
PDOException in Connection.php line 333:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'homestead.users' doesn't exist
in Connection.php line 333
at PDO->prepare('select count(*) as aggregate from `users` where `email` = ?') in Connection.php line 333
at Connection->Illuminate\Database\{closure}(object(MySqlConnection), 'select count(*) as aggregate from `users` where `email` = ?', array('adljasdlfsadkaklsdklsdjfjs@asdlfkajsldf.com')) in Connection.php line 722
at Connection->runQueryCallback('select count(*) as aggregate from `users` where `email` = ?', array('adljasdlfsadkaklsdklsdjfjs@asdlfkajsldf.com'), object(Closure)) in Connection.php line 685
at Connection->run('select count(*) as aggregate from `users` where `email` = ?', array('adljasdlfsadkaklsdklsdjfjs@asdlfkajsldf.com'), object(Closure)) in Connection.php line 349
at Connection->select('select count(*) as aggregate from `users` where `email` = ?', array('adljasdlfsadkaklsdklsdjfjs@asdlfkajsldf.com'), false) in Builder.php line 1610
@benbabics
benbabics / Exception
Created March 1, 2017 14:04
Error for registering /talent, /employer or when logging in
TokenMismatchException in VerifyCsrfToken.php line 67:
in VerifyCsrfToken.php line 67
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
export default Model.extend({
users: hasMany( 'user', { inverse: 'company' } ),
usersBilling: hasMany( 'user', { inverse: 'billingCompany' } ),
});
@benbabics
benbabics / components.my-component.js
Last active January 18, 2017 13:53
checkbox-all-valid-items
import Ember from 'ember';
export default Ember.Component.extend({
defaultAllChecked: false,
allValidItems: Ember.computed.oneWay( 'defaultAllChecked' ),
isAllChecked: Ember.computed('allValidItems', 'items.[]', function() {
return this.get('allValidItems.length') === this.get('items.length');
})
});
<header>
<h2>{{yield "title"}}</h2>
<p>{{yield "subtitle"}}</p>
</header>