Skip to content

Instantly share code, notes, and snippets.

Ben Babics benbabics

Block or report user

Report or block benbabics

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@benbabics
benbabics / example.js
Created Jun 2, 2019
teaching bob basic programmings
View example.js
var phrase = "I <3 Bob";
var bob = {
id: 51,
name: "Bob"
}
var ben = {
id: 38,
name: "Ben"
}
@benbabics
benbabics / docker-compose.yaml
Created May 24, 2017
sherpa docker-compose setup
View docker-compose.yaml
version: '2'
services:
### Applications Code Container #############################
applications:
image: tianon/true
volumes:
- ${APPLICATION}:/var/www
@benbabics
benbabics / Part One
Created May 2, 2017
Exception thrown locally while registering
View Part One
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 Mar 1, 2017
Error for registering /talent, /employer or when logging in
View Exception
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
View models-account.js
export default Model.extend({
users: hasMany( 'user', { inverse: 'company' } ),
usersBilling: hasMany( 'user', { inverse: 'billingCompany' } ),
});
@benbabics
benbabics / components.my-component.js
Last active Jan 18, 2017
checkbox-all-valid-items
View components.my-component.js
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');
})
});
View component-template.hbs
<header>
<h2>{{yield "title"}}</h2>
<p>{{yield "subtitle"}}</p>
</header>
View api_constraint.rb
class ApiConstraint
attr_reader :version
def initialize(options)
@version = options.fetch(:version)
end
def matches?(request)
request
.headers
@benbabics
benbabics / route-test.js
Created Sep 13, 2016
Ember Mock Service
View route-test.js
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: [] }) );
});
})
View api-clients.json
{
"data": {
"id": "79931a85-9dda-42d8-8103-fea6ba4fc4af",
"type": "client",
"attributes": {
"name": "GrubHub",
"company-id": "grubhub",
"address": "111 W Washington St, Chicago, IL 60602",
"createdAt": "2016-01-20T18:40:46.000Z",
"updatedAt": "2016-01-21T23:25:58.000Z"
You can’t perform that action at this time.