Skip to content

Instantly share code, notes, and snippets.

View bradleypriest's full-sized avatar

Bradley Priest bradleypriest

View GitHub Profile
/home/runner/tradegecko/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:774: [BUG] Segmentation fault
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0154 p:---- s:0763 e:000762 CFUNC :exec
c:0153 p:0011 s:0759 e:000758 METHOD /home/runner/tradegecko/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/postgresql_adapt
c:0152 p:0018 s:0754 e:000753 BLOCK /home/runner/tradegecko/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/postgresql/datab
c:0151 p:0006 s:0748 e:000747 BLOCK /home/runner/tradegecko/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract_adapter
c:0150 p:0026 s:0746 e:000745 METHOD /home/runner/tradegecko/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/notifications/instrumenter.rb:20
c:0149 p:0038 s:0740 e:0
module "User",
setup: ->
store = App.__container__.lookup("store:main")
@user = Ember.run ->
store.createRecord "user",
firstName: 'Bart'
lastName: 'Simpson'
roles: 'user,admin'
test "has a first name", ->
@bradleypriest
bradleypriest / Ember Tic Tac Toe.md
Last active November 10, 2019 20:24
Ember Tic Tac Toe
@bradleypriest
bradleypriest / konami.js
Last active December 17, 2015 00:29
Ember.KonamiCode
Ember.KonamiCode = Ember.Mixin.create({
konami: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13],
currentIndex: 0,
keyPress: function(event) {
this._super(event);
var index = this.get('currentIndex');
if (event.keyCode === this.konami[index]) {
if (index === 10) {
this.success();
} else {
// https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/components/development.js
// Updated for Ember 1.0-rc3
Ember.reloadTemplate = function(templateName) {
Ember.TEMPLATES.empty = Handlebars.compile("<div></div>");
$.getScript("/assets/templates/" + templateName, function(data, textStatus, jqXhr) {
delete Ember.Container.defaultContainer._container.cache.dict["template:" + templateName]
$.each(Ember.View.views, function() {
var _this = this;
if (this.get('templateName') === templateName) {
this.set('templateName', 'empty');
#= require spec_helper
#= require models/user
describe "User", ->
beforeEach ->
@user = App.User.createRecord
firstName: 'Bart'
lastName: 'Simpson'
roles: 'user,admin'
describe "name", ->
@bradleypriest
bradleypriest / ember-data.min.js
Last active December 12, 2015 10:09
Ember-Data (2013-02-10 08:36:19 -0800)
// ==========================================================================
// Project: Ember Data
// Copyright: ©2011-2012 Tilde Inc. and contributors.
// Portions ©2011 Living Social Inc. and contributors.
// License: Licensed under MIT license (see license.js)
// ==========================================================================
// Last commit: eaffebc (2013-02-10 08:36:19 -0800)
@bradleypriest
bradleypriest / gist:4473300
Created January 7, 2013 08:20
ember-data as at 7/1/13
(function() {
window.DS = Ember.Namespace.create({
// this one goes to 11
CURRENT_API_REVISION: 11
});
})();
@bradleypriest
bradleypriest / updated_gems.rb
Created October 8, 2012 10:09
Open all of your updated gem's changes at once
#!/usr/bin/env ruby
VERSION_REGEX = /\((\d.+)\)/
require 'net/http'
require 'json'
lines = `git diff Gemfile.lock`.split("\n")
# Line is a diffed line
lines.select!{ |line| ['+ ', '- '].include?(line.strip[0..1])}
# Line has a version
lines.select!{ |line| line.match(VERSION_REGEX) }
<script type="text/x-handlebars">
<button {{action loadBooks target="Welcome.booksController"}}>Load Books</button>
{{#collection contentBinding="Welcome.booksController" tagName="ul"}}
<b>{{view.content.title}}</b> - {{view.content.author}}, <i>{{view.content.genre}}</i>
{{/collection}}
</script>