Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.
CS183: Startup—Notes Essay—The Challenge of the Future
Purpose and Preamble
=begin | |
Message Pack vs similar utilities | |
ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-darwin10.0.0], MBARI 0x6770, Ruby Enterprise Edition 2010.02 | |
Packing | |
user system total real | |
pack: bert 18.320000 0.770000 19.090000 ( 19.101583) | |
pack: bson_ext 0.850000 0.030000 0.880000 ( 0.878398) | |
pack: json_ext 2.540000 0.040000 2.580000 ( 2.582495) |
Borrows heavily from: http://eddorre.com/posts/using-ruby-enterprise-edition-and-passenger-on-os-x-with-rvm | |
Install Xcode | |
Update Xcode if necessary | |
Install oh-my-zsh | |
https://github.com/robbyrussell/oh-my-zsh#readme | |
Install homebrew: http://mxcl.github.com/homebrew/ |
cat <<'BOOTSTRAP_AS_USER' > /home/$app_user/bootstrap_as_user.sh | |
set -e | |
bash < <( curl --insecure https://rvm.beginrescueend.com/install/rvm ) | |
rvm_include_string='[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' | |
grep "$rvm_include_string" ~/.bashrc || echo "$rvm_include_string" >> ~/.bashrc | |
cat <<'RVMRC_CONTENTS' > ~/.rvmrc |
if Rails.env.production? | |
require 'fileutils' | |
FileUtils.mkdir_p(Rails.root.join("tmp", "stylesheets", "admin")) | |
template_path_one = "#{Gem.loaded_specs['activeadmin'].full_gem_path}/app/assets/stylesheets" | |
template_path_two = "#{Gem.loaded_specs['activeadmin'].full_gem_path}/lib/active_admin/sass" | |
old_compile_path = "#{Rails.root}/public/stylesheets/admin" | |
new_compile_path = "#{Rails.root}/tmp/stylesheets/admin" | |
Sass::Plugin::remove_template_location template_path_one |
class ArticleImageUploader < ImageUploader | |
process :fix_exif_rotation | |
process :strip | |
process :convert => 'jpg' | |
process :quality => 85 # Percentage from 0 - 100 | |
version :gallery_thumb do | |
process :resize_to_fill => Settings.images.article_images.processing.gallery_thumb #44x44 | |
end |
Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.
CS183: Startup—Notes Essay—The Challenge of the Future
Purpose and Preamble
{ | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/User/Espresso Soda.tmTheme", | |
"ensure_newline_at_eof_on_save": true, | |
"file_exclude_patterns": | |
[ | |
".DS_Store", | |
".gitkeep", | |
"dump.rdb" | |
], |
self.startButton.rac_command = [RACCommand command]; | |
self.stopButton.rac_command = [RACCommand command]; | |
self.resetButton.rac_command = [RACCommand command]; | |
static const CGFloat interval = 0.01; | |
__unsafe_unretained id weakSelf = self; | |
// Signal id -> Signal Signal Number | |
// Map each click of the start button to a signal that fires at our interval | |
// and stops when the stop button's clicked. | |
id<RACSignal> start = [self.startButton.rac_command map:^(id _) { |
openssl req -new -newkey rsa:2048 -nodes -keyout server-cert.key -out server-cert-sign-req.csr
# Country Name (2 letter code) [AU]:US
# State or Province Name (full name) [Some-State]:California
# Locality Name (eg, city) []:
# Organization Name (eg, company) [Internet Widgits Pty Ltd]:Flutterby Labs, Inc.
# Organizational Unit Name (eg, section) []:
# Common Name (eg, YOUR name) []:www.dogo.co
class SendStats | |
include Sidekiq::Worker | |
sidekiq_options queue: :critical, retry: false | |
MEGABYTE = 1024.0 * 1024.0 | |
def perform | |
memcached_stats | |
redis_stats | |
postgres_stats |