Skip to content

Instantly share code, notes, and snippets.

View ChuckJHardy's full-sized avatar

Chuck J Hardy ChuckJHardy

View GitHub Profile
@ChuckJHardy
ChuckJHardy / example_activejob.rb
Last active March 12, 2025 21:24
Example ActiveJob with RSpec Tests
class MyJob < ActiveJob::Base
queue_as :urgent
rescue_from(NoResultsError) do
retry_job wait: 5.minutes, queue: :default
end
def perform(*args)
MyService.call(*args)
end
@ChuckJHardy
ChuckJHardy / fish_config.fish
Last active August 29, 2015 14:23
Fish Config
set -g -x PATH /usr/local/bin $PATH
set -g -x fish_greeting ''
# Compilation flags
set ARCHFLAGS="-arch x86_64"
set RUBY_GC_HEAP_INIT_SLOTS=1000000
set RUBY_HEAP_SLOTS_INCREMENT=1000000
set RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
set RUBY_GC_MALLOC_LIMIT=100000000

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
@ChuckJHardy
ChuckJHardy / reactjs-render-example.js
Created March 24, 2015 18:37
ReactJS Render Example
var mountNode = document.getElementsByTagName('my-mount-node');
var App = require('./components/App.jsx');
React.render(
<App mountNode={mountNode} dataAttributes={dataAttributes} />,
mountNode
);
@ChuckJHardy
ChuckJHardy / reactjs-example.js
Last active September 15, 2016 09:23
ReactJS Example Structure
React.createClass({
displayName: 'Name',
propTypes: {},
mixins: [],
getInitialState: function() {
return {};
},
getDefaultProps: function() {
@ChuckJHardy
ChuckJHardy / bridge-products-widget-example.html
Last active February 19, 2016 05:52
Bridge Products Widget Example
<!-- BRIDGE Products Widget Element
Action: Add
Location: Where the `Reservation` button should be located
Keys:
1. PRODUCT_VARIANT_ID - The variant ID for the product to be reserved
Description: The widget will load within this element and append the reservation button
-->
<bridge-products-widget id="[PRODUCT_VARIANT_ID]"></bridge-products-widget>
<!-- BRIDGE Products Widget Script

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@ChuckJHardy
ChuckJHardy / cnc-widget-example-client-app.html
Last active August 29, 2015 14:14
CnC Widget Example Client Application
<!doctype html>
<head>
<!-- CnC Widget Base Styles Include -->
<link href='https://bucket.s3.amazonaws.com/cf23df2207d99a74fbe169e3eba035e633b65d94.min.css' rel='stylesheet' type='text/css'>
</head>
<body>
<!-- CnC Widget Base Element -->
<div id="click-and-collect-reservation-widget"
data-client="cf23df2207d99a74fbe169e3eba035e633b65d94"
def view_css
path = "views/#{params[:controller]}/#{params[:action]}"
stylesheet_link_tag(path) unless Rails.application.assets.find_asset(path).nil?
end
@ChuckJHardy
ChuckJHardy / digital_ocean_setup.md
Last active August 27, 2024 04:03
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions