Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry session
Debugger
=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') |
Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry sessionDebugger
curl
to get the JSON response for the latest releasegrep
to find the line containing file URLcut
and tr
to extract the URLwget
to download itcurl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
-- show running queries (9.2) | |
SELECT pid, age(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- kill running query | |
SELECT pg_cancel_backend(procpid); | |
-- kill idle query |
Go to the official website and choose your OS.
Docker for Mac has a problem is the disk IO performance (see docker/for-mac#77).
There is a fix (https://github.com/IFSight/d4m-nfs) which makes Docker use NFS instead of OSXFS.
-module(recursion). | |
-export([fib/1, fibtail/1, fibtail/3, isPerfect/1]). | |
fib(0) -> | |
0; | |
fib(1) -> | |
1; | |
fib(N) when N > 0 -> | |
fib(N-1)+fib(N-2). |
📆 Jun 22-23, 2017
🌏 Web site: http://reddotrubyconf.com/ Twitter: http://twitter.com/reddotrubyconf
💁 Ping me @cheeaun on Twitter or leave a comment below if you found some awesome stuff for #rdrc2017. This gist will be updated whenever there's new stuff.
🕙 Previously, on RedDotRubyConf...
This hooks will remind you to reference task in your commit, and remember your task ref for branch. Your commit messages will have style "[reference] message"
[PROJECT_ROOT]/hooks/prepare-commit-msg.rb
and [PROJECT_ROOT]/hooks/post-checkout.rb
[PROJECT_ROOT]/hooks/prepare-commit-msg.rb
):#!/usr/bin/env ruby
class Object | |
def defer(method, *args) | |
@current_fibers ||= [] | |
@tracepoint ||= TracePoint.trace(:return) do |tp| | |
@current_fibers.reverse_each do |fib| | |
fib.resume | |
end | |
end | |
@current_fibers << Fiber.new do |
module ApplicationPolicy | |
READ = :read | |
MANAGE = :manage | |
MANAGE_FIELD = { parent_role: MANAGE } # NOTE(rstankov): Used for GraphQL fields | |
UPDATE = :update | |
MODERATE = :moderate |