Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
scrollLeft: null,
scrollTop: null,
actions: {
scrollChange(scrollLeft, scrollTop) {
this.set('scrollLeft', scrollLeft);
this.set('scrollTop', scrollTop);
@cball
cball / circle.yml
Last active May 4, 2017 15:30
circle.yml for ember apps
machine:
node:
version: 6.9.1
dependencies:
override:
- yarn
cache_directories:
- ~/.cache/yarn
test:
override:
@cball
cball / folder_structure
Last active October 7, 2017 18:03
Loading states in Ember with a pod folder structure
app
|
|-- pods
|
|-- admin
| |
| |-- index
| | |
| | |-- route.js
| | |-- template.hbs
@cball
cball / gist:5c8e3673a0a67fd64b10
Created September 5, 2014 13:21
AMS example response
{
"survey":{
"id":4,
"name":"Cool Survey",
"instructions": null,
"question_ids": [48,49]
}
}
get 'some/path/to/app/*', to: 'controller#action_that_uses_template_with_ember_stuff'
# user requests some/path/to/app/cool/path
# ember should see cool/path
@cball
cball / gist:9392345
Last active August 29, 2015 13:57
run downloaded logentries log from heroku app through oink
gunzip productionlog.gz
# if 63 changes in the future, you want to cut from the first char in date -> rails
cat productionlog.log | cut -c 63- | grep 'rails\[' > log/production-oink.log
oink --threshold=0 log/production-oink.log
@cball
cball / freshbooks_importer.rb
Last active December 14, 2015 23:39
Here's a simple script to migrate Freeagent invoice data -> Freshbooks. Putting this out there in case it helps someone else.
# gem install ruby-freshbooks
# https://github.com/elucid/ruby-freshbooks
#
# * Limitations *
# - Freshbooks Invoice #'s can only be 10 characters
# - requires creating clients ahead of time (though this would be easy for someone to add)
# - client names must match exactly
#
# * Usage *
# require 'freshbooks_importer'
@cball
cball / gist:2430852
Created April 20, 2012 18:22
Adding new staging servers & multiple branch deploys on heroku
## add new staging server locally that someone else created ##
# make sure you're a collaborator on the app
heroku apps
# assuming you already have directory cloned, if not clone it.
git remote add app2 [email protected]:app2.git
# deploy master
git push app2
@cball
cball / gist:2076871
Created March 18, 2012 16:28
Copy production heroku db to staging
# backup current production db
$ heroku pgbackups:capture --app myapp-production
# restore to staging
$ heroku pgbackups:restore DATABASE `heroku pgbackups:url --app myapp` --app myapp-staging
@cball
cball / application.css
Created March 8, 2012 00:49
Icon Font Usage
/* method taken from http://pictos.cc/articles/using-icon-fonts/ */
[data-icon]:before {
font-family: 'IcoMoonRegular';
content: attr(data-icon);
-webkit-font-smoothing: antialiased;
}
.icon {
strong {
text-indent: -99999px;