Skip to content

Instantly share code, notes, and snippets.

View rjswenson's full-sized avatar

Robin S. Healey rjswenson

  • Internet Superhighway
  • USA
View GitHub Profile
@rajraj
rajraj / gist:1388849
Created November 23, 2011 14:46
Capybara Reference
# Credit: http://richardconroy.blogspot.com/2010/08/capybara-reference.html
#Navigating
visit('/projects')
visit(post_comments_path(post))
#Clicking links and buttons
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
@hiltmon
hiltmon / development_profiler.rb
Created February 28, 2012 03:55
Simple class to wrap a profile run around some code
class DevelopmentProfiler
def self.prof(file_name)
RubyProf.start
yield
results = RubyProf.stop
# Print a flat profile to text
File.open "#{Rails.root}/tmp/performance/#{file_name}-graph.html", 'w' do |file|
@bantic
bantic / bucket_sync_service.rb
Created November 15, 2012 19:47
ruby class to copy from one aws s3 bucket to another
require 'aws/s3' # gem name is 'aws-sdk'
class BucketSyncService
attr_reader :from_bucket, :to_bucket, :logger
attr_accessor :debug
DEFAULT_ACL = :public_read
# from_credentials and to_credentials are both hashes with these keys:
# * :aws_access_key_id
@dLobatog
dLobatog / linkedlists.rb
Created January 9, 2013 01:43
Coding for interviews: LinkedLists and Ruby
################
# Tasks
################
# 1. A linked list is just a collection of linked nodes.
# Each node is linked to another node, which we call "next" in a singly linked list.
# In a doubly linked list, each node is linked to a "previous" and "next" node.
# These are the constraints that define our collection of nodes as a linked list.
# Extra! : http://softwarecake.com/post/29053008425/what-is-a-linked-list :) best description ever.
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active November 14, 2024 09:13
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@justsml
justsml / screenshot-capture-selection.sh
Created March 28, 2016 22:29
Linux/Debian Clone of Mac OSX 'Capture Screen Region' feature (map to similar Cmd+Ctrl+Shift+4)
#!/bin/bash
# Clone of Capture Screen Region on Mac OSX (map to similar Cmd-Ctrl-Shift-4)
# *** Requirements ***
# shutter - `apt-get install shutter`
# copyq - download from https://github.com/hluk/CopyQ/releases
shutter --select --no_session --exit_after_capture --output=/tmp/screenshot-surrent.png
copyq write image/png - < /tmp/screenshot-surrent.png && copyq select 0
rm /tmp/screenshot-surrent.png
@justsml
justsml / rsync options worth knowing.md
Created April 13, 2017 08:07
rsync: the good parts

Rsync is amazingly powerful

There are 100's of options for rsync

And I can't remember the options to save my life - and that man page, just goes on and on...

My cheat sheet is 99% of the important ones:

I'll add explainers and examples in a follow up.

@rjswenson
rjswenson / settings_template.md
Last active July 11, 2017 15:36
Settings Ticket template

Requirements for client settings.rb

  • client url (ex: spyn.spyder.com)
  • client platform name (ex: SPYN, Elastic)
  • Missing Images image
  • logo for pdfs
  • short client name (ex: fox)
  • long client name (ex: Fox Racing)
  • https /SSL ?
  • available on as data/info ?
@rjswenson
rjswenson / confirmer.html.erb
Last active June 5, 2017 20:24
email template for translations
Hello <%= @user.name %>,
<%= @custom_catalog.author.name %> has shared a catalog, <%= @custom_catalog.name %>, with you.
You can access this catalog from the dashboard under the "Custom Catalogs" section.
The catalog will be identified with a link icon to indicate its a shared catalog.
The shared catalog is read only. If you modify it, a new copy will be created for you
that is not linked to the shared catalog.
One of your assigned dealers, <%= @document.customer_name %> (<%= @document.author.name %>) has submitted a

Pushing things to QUAY without selling your soul

Quay is your next hip cloud thingy that's going to change the world. Here, we're going to use it as a Docker registry without giving it full write access to our GitHub account, because we're having cold feet.

You see, when you try to create a new Docker repository in Quay, it helpfully suggests pointing it to a GitHub repo, so it can do all Docker building stuff for you. But in order to let it do that, it wants to have full read and write access to all your repos, both private and public. Personally, I don't think