Skip to content

Instantly share code, notes, and snippets.

@buoyant
buoyant / gist:984d23e5bed66647d8ff11720389691f
Created August 20, 2022 09:31 — forked from hpjaj/gist:ef5ba70a938a963332d0
RSpec - List of available Expectation Matchers - from Lynda.com course 'RSpec Testing Framework with Ruby'
## From Lynda.com course 'RSpec Testing Framework with Ruby'
describe 'Expectation Matchers' do
describe 'equivalence matchers' do
it 'will match loose equality with #eq' do
a = "2 cats"
b = "2 cats"
expect(a).to eq(b)
@buoyant
buoyant / keybase.md
Created January 6, 2022 13:01
Keybase

Keybase proof

I hereby claim:

  • I am buoyant on github.
  • I am sandeeptota (https://keybase.io/sandeeptota) on keybase.
  • I have a public key whose fingerprint is 4543 1DCF 4731 6E7E 515A 9E68 CE5F A01F 42F0 D16C

To claim this, I am signing this object:

@buoyant
buoyant / MySQL_5-7_macOS.md
Created July 16, 2019 09:38 — forked from robhrt7/MySQL_5-7_macOS.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Multiple MySQL Versions with Homebrew

For homebrew version 0.9.5.

brew -v # => Homebrew 0.9.5

Install the current version of mysql.

# Install current mysql version

brew install mysql

@buoyant
buoyant / MySQL_macOS_Sierra.md
Created January 21, 2019 15:51 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@buoyant
buoyant / currency_symbols.php
Created February 13, 2018 07:54 — forked from gibbs/currency_symbols.php
An array of currency symbols as HTML entities
<?php
$currency_symbols = array(
'AED' => '&#1583;.&#1573;', // ?
'AFN' => '&#65;&#102;',
'ALL' => '&#76;&#101;&#107;',
'AMD' => '',
'ANG' => '&#402;',
'AOA' => '&#75;&#122;', // ?
'ARS' => '&#36;',
'AUD' => '&#36;',
@buoyant
buoyant / _credit_card_form.rhtml
Created August 25, 2017 13:40
unified credit card form
<p><i class="lock inline"></i> &nbsp;All information is sent via a secure SSL connection.</p>
<div class="checkout-row">
<p class='<%= @payment_gateway.cc_number_field[:p_class] %>'>
<%= label_tag $credit_card_number %>
<%= text_field_tag @payment_gateway.cc_number_field[:name], '', @payment_gateway.cc_number_field[:options] %>
</p>
<p>
@buoyant
buoyant / stripe_new_checkout_plugin.rb
Created August 25, 2017 13:37
StripeNewCheckoutPlugin
#-- encoding: UTF-8
module StripeNewCheckoutPlugin
def self.included(base)
base.class_eval do
#
end
end
# credit card commons fields
@buoyant
buoyant / deploy.rb
Created October 11, 2015 11:31 — forked from andruby/deploy.rb
Start and Stop tasks for resque workers, with capistrano deploy hook (without God)
after "deploy:symlink", "deploy:restart_workers"
##
# Rake helper task.
# http://pastie.org/255489
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/
def run_remote_rake(rake_cmd)
rake_args = ENV['RAKE_ARGS'].to_s.split(',')
cmd = "cd #{fetch(:latest_release)} && #{fetch(:rake, "rake")} RAILS_ENV=#{fetch(:rails_env, "production")} #{rake_cmd}"