#Atom Shortcuts
Shamelessly stolen borrowed from DRod
who shamelessly stole borrowed from Christina
##Settings
Access settings with cmd + ,
###Themes
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
<template> | |
<div></div> | |
</template> | |
<script> | |
import Trix from 'trix'; | |
export default { | |
props: ['value'], |
class ItemUploader < CarrierWave::Uploader::Base | |
require 'carrierwave/orm/activerecord' | |
include CarrierWave::RMagick | |
attr_reader :geometry | |
# Create thumbnail for images and PDFs | |
version :thumb, :if => :thumbable? do | |
process :resize_to_fit => [240, 240], :if => :image? | |
process :pdf_preview => [240, 240], :if => :pdf? |
# /etc/nginx/sites-enabled/SITE_NAME | |
server { | |
server_name SERVER_NAME.com; | |
passenger_enabled on; | |
rails_env production; | |
root /home/deploy/APP_NAME/current/public; | |
# redirect server error pages to the static page /50x.html | |
error_page 500 502 503 504 /50x.html; |
#Credits: http://tomafro.net/2009/09/quickly-list-missing-foreign-key-indexes | |
c = ActiveRecord::Base.connection | |
c.tables.collect do |t| | |
columns = c.columns(t).collect(&:name).select {|x| x.ends_with?("_id" || x.ends_with("_type"))} | |
indexed_columns = c.indexes(t).collect(&:columns).flatten.uniq | |
unindexed = columns - indexed_columns | |
unless unindexed.empty? | |
puts "#{t}: #{unindexed.join(", ")}" |
require 'net/http' | |
require 'json' | |
TEAMS_URL = 'https://statsapi.web.nhl.com/api/v1/teams' | |
DATA_URL = 'https://statsapi.web.nhl.com/api/v1/schedule?startDate=2019-10-02&endDate=2020-04-04&expand=schedule.linescore' | |
def fetch_data(url) | |
uri = URI(url) | |
response = Net::HTTP.get(uri) | |
JSON.parse(response) |
// src/App.vue | |
// I use Vuetify in almost all of my Vue apps so this is how __I__ handle alerting the user to an update. | |
// Your implementation may change based on your UI | |
<template> | |
<!-- normal vue views stuff --> | |
<v-snackbar bottom right :value="updateExists" :timeout="0" color="primary"> | |
An update is available | |
<v-btn text @click="refreshApp"> | |
Update |