Skip to content

Instantly share code, notes, and snippets.

View artzte's full-sized avatar

Eric Artzt artzte

  • Fieldwire
  • Bend, OR
View GitHub Profile
<html>
<style>
.truncated span {
display: inline-block;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
}
.w5 {
width: 5rem;
@artzte
artzte / recursive fetch example
Created January 30, 2017 05:16
recursive fetch example
let users = [];
let offset = 0;
function doQuery() {
return this.store.query('users', {$top: 100, $offset: offset, accountId: cup.getAccountId()}).then((result) {
users = users.concat(results);
if (offset + results.get('length') < results.get('meta.recordsetCount')) {
return doQuery();
}
else return users;
@artzte
artzte / actor-role-invite.txt
Created June 21, 2015 14:53
Transcript of actor role invite functional test
POST /login 302 424.332 ms - 35
inviting actor { name: 'test actor 83172377-6b9f-4482-9a68-782df2ea0a95',
contactEmail: '83172377-6b9f-4482-9a68-782df2ea0a95@avalara.com',
id: 'd49dd357cea14f648c8a441649006023' }
account of inviting actor { accountName: 'Account 83172377-6b9f-4482-9a68-782df2ea0a95',
id: 'dab6f5bd6444402eabaf660e6f987070' }
seeds2 actor { name: 'test actor 2a8e8722-c96e-4fe2-ae48-609bd19b9e44',
contactEmail: '97a09a5f-5274-42ed-9ecc-62312022eb73@mail.avlr.sh',
id: '5da3c0e9088045adb6151c2e8ccaa417' }
POST /api/accounts/dab6f5bd6444402eabaf660e6f987070/users 200 545.474 ms - 120
@artzte
artzte / gist:9086483
Last active August 29, 2015 13:56
ember app kit routing
e.g., this router:
Router.map(function() {
this.resource('pages', function() {
this.route('new');
this.route('show', {path: ':page_id'});
this.route('edit', {path: ':page_id/edit'});
});
});
@artzte
artzte / gist:5758327
Created June 11, 2013 16:24
Stack trace when booting app in production environment - possible ember-rails issue
==> /data/ama/log/unicorn.log <==
E, [2013-06-11T09:18:18.475152 #3331] ERROR -- : undefined method `ember' for #<Rails::Application::Configuration:0xa0792ac> (NoMethodError)
/ama/vendor/bundle/ruby/1.9/gems/railties-3.2.13/lib/rails/railtie/configuration.rb:85:in `method_missing'
/ama/config/environments/production.rb:72:in `block in <top (required)>'
/ama/vendor/bundle/ruby/1.9/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:24:in `class_eval'
/ama/vendor/bundle/ruby/1.9/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:24:in `configure'
/ama/config/environments/production.rb:1:in `<top (required)>'
/ama/vendor/bundle/ruby/1.9/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/ama/vendor/bundle/ruby/1.9/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
/ama/vendor/bundle/ruby/1.9/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
irb(main):020:0> ns = AmaNotification.find_by_timestamp "2013-03-04 04:34:38.96488"
AmaNotification Load (0.9ms) SELECT "ama_notifications".* FROM "ama_notifications" WHERE "ama_notifications"."timestamp" = '2013-03-04 04:34:38.96488' LIMIT 1
=> #<AmaNotification id: 164, event: "ama_networks_update", data: "{\"overlay_ids\":[2]}", timestamp: "2013-03-04 04:34:38", session_id: nil>
irb(main):021:0> ns.attributes_before_type_cast["timestamp"] => "2013-03-04 04:34:38.96488"
irb(main):022:0> AmaNotification.where("timestamp = ?", ns.timestamp).to_sql
=> "SELECT \"ama_notifications\".* FROM \"ama_notifications\" WHERE (timestamp = '2013-03-04 04:34:38.964880')"
irb(main):023:0> AmaNotification.where("timestamp = ?", ns.attributes_before_type_cast["timestamp"]).to_sql
=> "SELECT \"ama_notifications\".* FROM \"ama_notifications\" WHERE (timestamp = '2013-03-04 04:34:38.96488')"
irb(main):024:0>
@artzte
artzte / gist:4954715
Created February 14, 2013 17:57
which controller instance is used?
App.NetworkDeviceRoute = Em.Route.extend
model: (params) ->
unless params.device_id
App.Device.create
name: 'Untitled'
setupController: (controller, model) ->
console.log "network device controller: #{controller}"
controller.set('content', model)
# nothing?
renderTemplate: ->
@artzte
artzte / errors.log
Created December 7, 2012 23:46
openshift log output on failed wordpress create
[test-baddabigboom.rhcloud.com ~]\> cat ~/haproxy-1.4/logs/*.log
[WARNING] 341/180151 (842) : config : log format ignored for proxy 'stats' since it has no log address.
[WARNING] 341/180151 (842) : config : log format ignored for proxy 'express' since it has no log address.
[WARNING] 341/180151 (842) : [/usr/sbin/haproxy.main()] Cannot raise FD limit to 8014.
[WARNING] 341/180151 (842) : [/usr/sbin/haproxy.main()] FD limit (1024) too low for maxconn=4000/maxsock=8014. Please raise 'ulimit-n' to 8014 or more to avoid any trouble.
# Logfile created on 2012-12-07 18:02:28 -0500 by logger.rb/31641
I, [2012-12-07T18:02:28.490116 #1504] INFO -- : Starting haproxy_ctld
D, [2012-12-07T18:02:28.498128 #1504] DEBUG -- : GEAR_INFO - capacity: 0.0% gear_count: 1 sessions: 0 up/remove_thresh: 90.0%/49.9% sec_left_til_remove: 120 gear_remove_thresh: 0/20
I, [2012-12-07T18:03:47.296406 #5530] INFO -- : Starting haproxy_ctld
D, [2012-12-07T18:03:47.297870 #5530] DEBUG -- : GEAR_INFO - capacity: 0.0% gear_count: 1 sessions:
The symlink:
[home-lonin.rhcloud.com ~]\> ls -lah ~/app-root/runtime/repo/php/.htaccess
lrwxrwxrwx. 1 xxx xxx 103 Dec 5 16:13 /var/lib/openshift/xxx/app-root/runtime/repo/php/.htaccess -> /var/lib/openshift/xxx/app-root/runtime/repo//work/config/htaccess.dotfile
Here is the htaccess
[home-lonin.rhcloud.com ~]\> cat ~/app-root/runtime/repo/php/.htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
@artzte
artzte / app.rb
Created September 10, 2012 21:50
# Use the app.rb file to load Ruby code, modify or extend the models, or
# do whatever else you fancy when the theme is loaded.
module Nesta
class App
helpers do
# Add new helpers here.
end