This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module '@ember/utils' { | |
import { TypeOf } from '@ember/utils/-private/types'; | |
type EmptyType = null | undefined | '' | false | 0 | []; | |
type BlankType = null | undefined | '' | [] | '\n\t' | ' '; | |
type NoneType = null | undefined; | |
type TypeOfType = | |
| 'string' | |
| 'number' | |
| 'boolean' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
# | |
# Wait.until { expr } -- waits until expr is true | |
# Wait.while { expr } -- waits while expr is true | |
# | |
# Each iteration contains a `sleep(sleep_time)`, where the default sleep time is | |
# Wait::DEFAULT_SLEEP_TIME (0.1 seconds). | |
# | |
# The sleep interval can be specified with the `sleep_time` argument: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This migration comes from active_storage (originally 20170806125915) | |
class CreateActiveStorageTables < ActiveRecord::Migration[5.1] | |
def change | |
create_table :active_storage_blobs, id: :uuid do |t| | |
t.string :key, null: false | |
t.string :filename, null: false | |
t.string :content_type | |
t.text :metadata | |
t.string :service_name, null: false | |
t.bigint :byte_size, null: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Copy into the root project dir | |
# 2. `docker-compose start` | |
# 3. Add the following to `config/database.yml`: | |
# | |
# default: &default | |
# ... | |
# username: postgres | |
# password: postgres | |
# host: localhost | |
# port: 5432 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OH MY GLOB | |
# | |
# DO ANYTHING. BE ANYONE. | |
# ALL GLORY BE TO GLOB. | |
# | |
# Glob will respond to anything with `nil`. | |
# You can initialize Glob. go ahead! *Grob bringeth to all* | |
# myglob = Glob.new("oh", { my: GLOB }) | |
# Now call your methods. "Gob returnith to all* | |
# myglob.i_made_up_this_method #=> nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias nukeit="bundle exec rake db:drop && bundle exec rake db:create && bundle exec rake db:migrate && bundle exec rake db:seed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import ToriiFirebaseAdapter from 'emberfire/torii-adapters/firebase'; | |
export default ToriiFirebaseAdapter.extend({ | |
store: Ember.inject.service('store'), | |
firebase: Ember.inject.service('firebase'), | |
raven: Ember.inject.service('raven'), | |
findAndSetUser(data) { | |
return this.get('store').findRecord('user', data.currentUser.uid).then((user) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
const { Service, get, set, A, RSVP: { Promise }, inject: { service }, assert } = Ember; | |
export default Service.extend({ | |
firebaseApp: service(), | |
/** | |
* Link two records, there must be a relationship with an inverse between the two records | |
* @param {DS.Model} recordA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
actions: { | |
accessDenied() { | |
this.transitionTo('index'); | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. `brew update` | |
# 2. `brew install bash-completion` | |
# 3. `curl -o ~/.git-prompt.sh https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh` | |
# 4. Add the following to ~/.bashrc | |
if [ -f $(brew --prefix)/etc/bash_completion ]; then | |
. $(brew --prefix)/etc/bash_completion | |
fi | |
source ~/.git-prompt.sh | |
GIT_PS1_SHOWDIRTYSTATE=true |
NewerOlder