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
# remap prefix to Control + a | |
set -g prefix C-a | |
set -g default-terminal "xterm-256color" | |
set -s escape-time 0 | |
# bind 'C-a C-a' to type 'C-a' | |
bind C-a send-prefix | |
unbind C-b | |
# Lines of history |
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
<header class="school-website-header uk-z-4"> | |
<div class="uk-padding-horizontal uk-container uk-container-center"> | |
<nav class="uk-navbar" data-behavior="dropdown"> | |
<a href="{{current_school.logo_navigation_url}}" class="uk-brand"> | |
{{ if current_school.logo_url }} | |
<img src="{{current_school.logo_url}}" alt="{{current_school.name}}"> | |
{{ else }} | |
<span class="uk-text-large uk-text-bold">{{ current_school.name }}</span> | |
{{ end }} | |
</a> |
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
# Should be 8 records | |
ActiveRecord::Base.connection.execute(MembershipSummary.includes(:person).where(school_id: 2, group_id: 1).order("people.first_name asc NULLS LAST, person_id asc NULLS LAST").to_sql).count | |
# Should be 8 records but only returns 1 | |
MembershipSummary.includes(:person).where(school_id: 2, group_id: 1).order("people.first_name asc NULLS LAST, person_id asc NULLS LAST").to_a.size | |
# 'joins' does what we want and returns 8 records. Maybe we can figure out how to get ransack to do a join instead of includes | |
MembershipSummary.joins(:person).where(school_id: 2, group_id: 1).order("people.first_name asc NULLS LAST, person_id asc NULLS LAST").to_a.size |
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
# Here's a contrived example of a LEFT JOIN using ARel. This is an example of | |
# the mechanics, not a real-world use case. | |
# == DEFINITIONS | |
# - A Taxi is a car for hire. A taxi has_many :passengers. | |
# - A Passenger records one person riding in one taxi one time. It belongs_to :taxi. | |
class Taxi < ActiveRecord::Base | |
# This scope LEFT JOINs the Passenger table. You might use this if you wanted | |
# to select taxis by a set of taxi and passenger IDs (as with the |
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
curl -o a425.dump `heroku pg:backups public-url a425 -r remote-name` |
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
heroku pg:backups -r production # list existing backups | |
curl -o a123.dump `heroku pg:backups public-url a123 -r production` # pull the backup down locally | |
pg_restore --verbose --clean --no-acl --no-owner -h localhost -d AppName_enviroment a123.dump | |
# Or even quicker | |
heroku pg:backups restore `heroku pg:backups public-url a123 -r sk-git-remote` DATABASE_URL -r sk-git-remote |
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
module FileType | |
2 module ProcessingGroup | |
3 Box = [PDF, Word, Powerpoint] | |
4 Video = [Video] | |
5 end |
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
curl https://gist.githubusercontent.com/rupurt/a9e35c8c219a37eb90f6/raw/2397544c86ef149eedc3a3e9c645f3eb3c7319a7/update_ssl_cert.sh > /tmp/update_ssl_cert.sh && chmod 744 /tmp/update_ssl_cert.sh && /tmp/update_ssl_cert.sh |
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
#!/bin/bash | |
cd /usr/local/etc/openssl/certs/ | |
curl -O http://curl.haxx.se/ca/cacert.pem | |
mv cacert.pem cert.pem | |
echo "export SSL_CERT_FILE=/usr/local/etc/openssl/certs/cert.pem" >> ~/.bash_profile.local | |
source ~/.bash_profile |
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
<style> | |
@font-face { | |
font-family: 'action_manbold_italic'; | |
src: url('https://youdomain.com/some_folder/action_man_bold_italic-webfont.eot'); | |
src: url('https://youdomain.com/some_folder/action_man_bold_italic-webfont.eot?#iefix') format('embedded-opentype'), | |
url('https://youdomain.com/some_folder/action_man_bold_italic-webfont.woff2') format('woff2'), | |
url('https://youdomain.com/some_folder/action_man_bold_italic-webfont.woff') format('woff'), | |
url('https://youdomain.com/some_folder/action_man_bold_italic-webfont.ttf') format('truetype'), | |
url('https://youdomain.com/some_folder/action_man_bold_italic-webfont.svg#action_manbold_italic') format('svg'); | |
font-weight: normal; |