Skip to content

Instantly share code, notes, and snippets.

View trek's full-sized avatar
🏳️‍🌈

Trek Glowacki trek

🏳️‍🌈
View GitHub Profile
@trek
trek / example.css
Last active December 19, 2015 22:48 — forked from gfranko/example.js
.ember-view .tooltip {
display:none;
}
.ember-view.tip-visible .tooltip {
display:block;
}
@trek
trek / example.js
Last active December 19, 2015 22:39 — forked from gfranko/example.js
App = Ember.Application.create();
App.ExampleController = Ember.Controller.extend({
select: function(){
console.log("an example image was clicked");
}
});
@trek
trek / app.js
Created August 15, 2012 12:25 — forked from tomchiverton/app.js
EmberJS list control that can tell what was clicked
EvEditor = Em.Application.create({
main: { componentList:[{name:'a'},{name:'b'},{name:'c'}]
});
EvEditor.ApplicationController = Em.Controller.extend()
EvEditor.ApplicationView = Em.View.extend({
templateName: 'application'
});
EvEditor.ComponentListController = Ember.ArrayController.extend({
@trek
trek / default
Created March 23, 2011 03:12 — forked from mauricio/default
# as we’re going to use Unicorn as the application server
# we’re not going to use common sockets
# but Unix sockets for faster communication
upstream shop {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a
# single worker for timing out).
# for UNIX domain socket setups:
server unix:/tmp/shop.socket fail_timeout=0;
# JSON-encoded error and redirect results for Devise controllers.
# This overrides an internal method of Devise, so be careful when updating Devise!
#
# Usage:
#
# class Users::RegistrationsController < Devise::RegistrationsController
# include DeviseJsonAdapter
# end
#
# devise_for :users, :controllers => { :registrations => "users/registrations" }
SIGN UP
curl -H "Content-Type:application/json" -H "Accept:application/json" \
-d "{\"user\":{\"password_confirmation\":\"12345678\", \"password\":\"12345678\", \"email\":\"test5@test.com\"}}" \
http://your_server.com/users
SIGN IN
curl -H "Content-Type:application/json" -H "Accept:application/json" \
-d "{\"user\":{\"remember_me\":\"0\", \"password\":\"12345678\", \"email\":\"test5@test.com\"}}" \
http://your_server.com/users/sign_in
block {
value «int»
block {
block {
value «bool»
value «foo»
}
}
value «float»}
«int» 5
@trek
trek / gist:274878
Created January 12, 2010 03:41 — forked from ignu/gist:274868
class NamedEntity
def self.inherited(subclass)
subclass.include DataMapper::Resource
subclass.property :id, Serial
subclass.property :name, String
end
end
class Goal < NamedEntity
has n, :targeting_goals
@trek
trek / gist:274877
Created January 12, 2010 03:41 — forked from ignu/gist:274868
class Goal
include DataMapper::Resource
property :id, Serial
property :name, String
has n, :targeting_goals
end