- Keep your system up to date:
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo reboot
- Make sure you've got an internet connection.
- Make sure you've got
- wget
# Channel | |
class CommentsChannel < ApplicationCable::Channel | |
def self.broadcast_comment(comment) | |
broadcast_to comment.message, comment: CommentsController.render( | |
partial: 'comments/comment', locals: { comment: comment } | |
) | |
end | |
def follow(data) | |
stop_all_streams |
Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets
“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important
or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”
You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?
HTTP status code symbols for Rails | |
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
Status Code Symbol | |
1xx Informational | |
100 :continue | |
101 :switching_protocols | |
102 :processing |
--- | |
# packages.yml | |
- name: Add postgres repository | |
apt_repository: repo='deb http://apt.postgresql.org/pub/repos/apt/ {{ansible_distribution_release}}-pgdg main' state=present | |
- name: Add postgres repository key | |
apt_key: url=http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc state=present | |
module ActiveRecord | |
module RailsAdminEnum | |
def enum(definitions) | |
super | |
definitions.each do |name, values| | |
define_method("#{ name }_enum") { self.class.send(name.to_s.pluralize).to_a } | |
define_method("#{ name }=") do |value| | |
if value.kind_of?(String) and value.to_i.to_s == value |
# encoding: utf-8 | |
class AlbumForm < BaseForm | |
has_many :songs, class_name: 'SongForm' | |
validates :songs, form_collection: true | |
end |
####################################################################################################################### | |
# This Gist is some crib notes/tests/practice/whatever for talking to Active Directory via LDAP. The (surprisingly | |
# helpful) documentation for Net::LDAP can be found here: http://net-ldap.rubyforge.org/Net/LDAP.html | |
####################################################################################################################### | |
require 'rubygems' | |
require 'net/ldap' | |
####################################################################################################################### | |
# HELPER/UTILITY METHOD |
/** | |
* Image with an on hover fade in-out caption. | |
*/ | |
@import url(http://fonts.googleapis.com/css?family=Oswald); | |
/** | |
* Natural box-model | |
*/ |
# here | |
alias vba='vim ~/.bash_aliases' | |
alias mba='mate ~/.bash_aliases' | |
alias sba='subl ~/.bash_aliases' | |
alias ba='source ~/.bash_aliases' | |
# profile | |
alias sbp='subl ~/.bash_profile' | |
alias bp='source ~/.bash_profile' | |
# bundle | |
alias bu='bundle' |