Skip to content

Instantly share code, notes, and snippets.

View frznk-tank's full-sized avatar
👌
¯\_(ツ)_/¯

Frznk frznk-tank

👌
¯\_(ツ)_/¯
View GitHub Profile
@frznk-tank
frznk-tank / snippet.rb
Created January 6, 2021 14:57 — forked from timm-oh/snippet.rb
Ozow integration
# refer to https://ozow.com/integrations/ for more information
# Ordering with the params matters, see the link above for more information
ozow_params = {
'SiteCode': 'SOME_SITE_CODE', # find this here https://dash.ozow.com/MerchantAdmin/Site
'CountryCode': 'ZA', # only supports ZA currently
'CurrencyCode': 'ZAR', # only supports ZAR currently
'Amount': 1000.00, # this is R1000.00
'TransactionReference': 'SOME_TEST', # your internal reference to match against
'BankReference': "Nice Reference", # the reference that the customer will see on their bank statement
@frznk-tank
frznk-tank / font_grabber.rb
Created July 20, 2016 22:03 — forked from ttscoff/font_grabber.rb
Give it a <link> from Google fonts and get back CSS with fonts embedded
#!/usr/bin/ruby
# encoding: utf-8
# Grab google web fonts and embed them as base64 data URIs
# <http://brettterpstra.com/2015/03/14/embedding-google-web-fonts/>
require 'base64'
if ARGV.length > 0
input = ARGV
elsif STDIN.stat.size > 0
input = STDIN.read.strip.split(/\n+/)
mymodule {
@at-root {
.#{&}-header { ... }
.#{&}-footer { ... }
.#{&}-body {
a { ... }
span { ... }
p { ... }
}
}
@frznk-tank
frznk-tank / Haml.tmLanguage
Created February 18, 2012 10:57 — forked from unixmonkey/Haml.tmLanguage
Haml Language definition file for TextMate; modified to work with Sublime Text 2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>haml</string>
<string>sass</string>
</array>
<key>foldingStartMarker</key>
# In your test_helper.rb
class ActiveRecord::Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || retrieve_connection
end
end