brew update
brew install rabbitmq
To see if rabbitmq is running after following the installation instructions:
launchctl list | grep rabbit
> 48303 - homebrew.mxcl.rabbitmq
# http://docs.rubygems.org/read/chapter/11 | |
--- | |
gem: --no-ri --no-rdoc | |
benchmark: false | |
verbose: true | |
update_sources: true | |
sources: | |
- http://gems.rubyforge.org/ | |
- http://rubygems.org/ | |
backtrace: true |
import { Controller } from "@hotwired/stimulus" | |
export default class extends Controller { | |
static targets = [ "slide" ] | |
initialize() { | |
this.index = 1 | |
} | |
next(e) { |
brew install nginx
sudo cp /usr/local/Cellar/nginx/1.8.0/homebrew.mxcl.nginx.plist /Library/LaunchDaemons
Replace /usr/local/etc/nginx/nginx.conf
with the nginx.conf
in this gist. I'm using port 8888 for my current project. Obviously, change server_name
as well, and probably the name of its access log.
/* **She grows old and feeble** */ | |
//...But she would always have to return back to her dull world of chores and grown-ups. | |
return function() { | |
// And her latest story would be filled with wonder | |
latestStory = adventures[adventures.length - 1]; | |
// But time is a bitch... | |
setInterval(function() { | |
// and our dear princess can't help but forget her adventures, |
Typically, Rails views are rendered after some controller action is executed. But the code that powers Rails controllers are flexible and extensible enough to create custom rendering objects that can reuse views and helpers, but live outside of web request processing. In this post, I'll cover what a Rails controller is and what it's composed of. I'll also go over how to extend it to create your own customer renderers, and show an example of how you can render views in your background jobs and push the results to your frontend.
A Rails controller is a subclass of ActionController::Base
. The documentation says:
Action Controllers are the core of a web request in Rails. They are made up of one or more actions that are executed on request and then either render a template or redirect to another action. An action is defined as a public method on the controller, wh
require 'rack' | |
class RackApp | |
def self.call(env) | |
[200, {'Content-Type' => 'text/html'}, ['derp']] | |
end | |
end | |
# For a full list of options, see | |
# http://www.ruby-doc.org/stdlib-1.9.3/libdoc/webrick/rdoc/WEBrick.html |
# 1) Running a raw RackAdapter in config.ru mounted at '/' works fine | |
require 'bundler/setup' | |
require 'yard' | |
run YARD::Server::RackAdapter.new( | |
{'surfiki' => [YARD::Server::LibraryVersion.new('surfiki', nil, File.expand_path('../.yardoc', __FILE__))]}, | |
{ | |
:single_library => true, | |
:caching => false | |
}) |
# Clean up Mint exported transactions for working with a spreadsheet | |
# | |
# Usage: | |
# | |
# ruby mint.rb <transactions.csv> | |
# | |
# Export a CSV of transactions from Mint | |
# | |
# Tags are not exported, so it must be filtered out before export: | |
# |
Last login: Tue Aug 23 13:16:58 on ttys003 | |
jch@Jerrys-MacBook-Pro:~$ cd projects/ruby-net-ldap/ | |
jch@Jerrys-MacBook-Pro:~/projects/ruby-net-ldap[tls-verify-hostnames]$ cd test/support/vm/openldap | |
jch@Jerrys-MacBook-Pro:~/projects/ruby-net-ldap/test/support/vm/openldap[tls-verify-hostnames]$ vagrant destroy | |
==> default: VM not created. Moving on... | |
jch@Jerrys-MacBook-Pro:~/projects/ruby-net-ldap/test/support/vm/openldap[tls-verify-hostnames]$ gem uninstall vagrant | |
jch@Jerrys-MacBook-Pro:~/projects/ruby-net-ldap/test/support/vm/openldap[tls-verify-hostnames]$ rbenv rehash | |
jch@Jerrys-MacBook-Pro:~/projects/ruby-net-ldap/test/support/vm/openldap[tls-verify-hostnames]$ hash -r | |
jch@Jerrys-MacBook-Pro:~/projects/ruby-net-ldap/test/support/vm/openldap[tls-verify-hostnames]$ vagrant plugin install vagrant-vbguest | |
Installing the 'vagrant-vbguest' plugin. This can take a few minutes... |