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 / 01_readme.md
Last active June 15, 2020 06:52
Sass baseline mixin

Usage

  h1,
  h2,
  h3,
  h4,
  h5,
  h6
 color: $c-txtPrimary
@frznk-tank
frznk-tank / application_helper.rb
Last active March 19, 2021 11:35
Stimulus slim view helpers
# app/helpers/application_helper.rb
module ApplicationHelper
include StimulusHelper::HelperMethods
end
@frznk-tank
frznk-tank / .travis.yml
Created August 19, 2018 19:33
Postgres 10 on Travis
env:
global:
- PGPORT=5433
language: ruby
rvm:
- 2.5.1
cache:
@frznk-tank
frznk-tank / USAGE.md
Created July 19, 2018 09:44
Basic Sidekiq config

Starting Sidekiq

bundle exec sidekiq -C config/sidekiq.yml

Perform Job Immediately

TestJob.perform_now(user_id: current_user.id)
@frznk-tank
frznk-tank / control_indicator_helper.rb
Last active July 18, 2018 00:01
SimpleForm Initializer for Foundation 6 with additional markup to allow styling of checkboxes, radio buttons and file controls
# lib/components/control_indicator_helper.rb
module ControlIndicatorComponent
def select_arrow(wrapper_options=nil)
@arrow_icon ||= begin
if options[:arrow_icon].nil? || options[:arrow_icon].to_s == 'default'
''
else
options[:arrow_icon].to_s.html_safe
end
@frznk-tank
frznk-tank / gist:af1e3c3dba1627451abc8552a5e99baf
Last active June 25, 2018 13:13
Ruby random South African ID number generator
def id_number(birthday, gender)
gender = (0..4).to_a.sample if gender == 'female'
gender = (5..9).to_a.sample if gender == 'male'
random_sequence = rand.to_s[2..5]
citizenship = 0
race = 8
id_number = [
birthday.gsub('-', '')[2..-1],
gender,
@frznk-tank
frznk-tank / 1-README.md
Last active August 1, 2017 10:12
Heroku Reporting Dynos

Setup

  • Add a new worker to your Procfile. In this gist I used reporter
  • Add the Heroku Platform gem to your Gemfile
  • Create the HerokuReporterDyno module in lib or any other auto-loadable path
  • Create two jobs. A caller (Reporting::GeneratorJob) and a runner (Reporting::RunnerJob)
  • Deploy
  • Once deployed, log into Heroku and change the newly added reporter dyno to a Performance M or Performance M dyno

How this all works

@function hsb($hue, $saturation, $brightness, $alpha: 1, $hsl-saturation: '') {
@if $brightness == 0 {
@return hsla(0, 0, 0, $alpha);
} @else {
$hsl-lightness: (2 - $saturation / 100) * ($brightness / 2);
$hsl-saturation: ($brightness * $saturation) / if($hsl-lightness < 50, $hsl-lightness * 2, 200 - $hsl-lightness * 2);
@return hsla($hue, $hsl-saturation, $hsl-lightness, $alpha);
}
}
@frznk-tank
frznk-tank / _helpers.sass
Created November 20, 2016 19:58
Foundation Helpers
// Create helper classes from $foundation-palette
@each $color, $hex-value in $foundation-palette
.color--#{$color}
color: $hex-value
.color--bg-#{$color}
background-color: $hex-value
// Create helper classes from $header-sizes
@each $size, $headers in $header-sizes
+breakpoint($size)