Skip to content

Instantly share code, notes, and snippets.

@roberthopman
roberthopman / routes_to_csv.rb
Last active March 25, 2025 19:19 — forked from adamdullenty/routes_csv.rake
copy paste rails routes to csv
# Add as Rake task or Rails console
class CSVFormatter
def initialize
@buffer = []
end
def result
@buffer.join("\n")
end
@roberthopman
roberthopman / system-wide-clipboard.zsh
Created May 5, 2024 15:58 — forked from welldan97/system-wide-clipboard.zsh
Zsh copy & paste system wide for OS X, like in emacs
pb-kill-line () {
zle kill-line
echo -n $CUTBUFFER | pbcopy
}
pb-kill-whole-line () {
zle kill-whole-line
echo -n $CUTBUFFER | pbcopy
}
  • Dynamic Dispatch
  • Dynamic Method
  • Ghost Methods
  • Dynamic Proxies
  • Blank Slate
  • Kernel Method
  • Flattening the Scope (aka Nested Lexical Scopes)
  • Context Probe
  • Class Eval (not really a 'spell' more just a demonstration of its usage)
  • Class Macros
@roberthopman
roberthopman / script.sh
Created June 11, 2023 09:29 — forked from vielhuber/script.sh
PostgreSQL: Backup and restore export import pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@roberthopman
roberthopman / Selenium Cheat Sheet.md
Created February 7, 2021 16:42 — forked from kenrett/Selenium Cheat Sheet.md
Selenium Cheat Sheet - Ruby

#Getting Started

##Webpage:

<html>
<head>
    <title>Testing with Ruby and Selenium WebDriver</title>
</head>
 
<body bgcolor="antiquewhite">
@roberthopman
roberthopman / capybara cheat sheet
Created November 4, 2020 10:33 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=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')
@roberthopman
roberthopman / wip_graphql_demo.rb
Created October 25, 2018 13:36 — forked from skatkov/wip_graphql_demo.rb
Ruby example of creating a todo and then completing it using wip.chat graphql.
# NOTE: Be sure to set the API key further down in the code!
require "net/http"
require "uri"
require "json"
class WIP
def initialize(api_key:)
@api_key = api_key
end