Skip to content

Instantly share code, notes, and snippets.

View itzbernoulli's full-sized avatar

Ayodeji Oyinloye itzbernoulli

View GitHub Profile
@alvincrespo
alvincrespo / application_helper.rb
Created July 21, 2022 11:02
TailwindUI + will_paginate renderer
module ApplicationHelper
def will_paginate(coll_or_options = nil, options = {})
if coll_or_options.is_a? Hash
options = coll_or_options
coll_or_options = nil
end
options = options.merge renderer: TailwindUIPaginationRenderer unless options[:renderer]
super(*[coll_or_options, options].compact)
end
end
@kamalptw
kamalptw / Metronic Theme in Rails (Or any other framework)
Last active March 1, 2023 09:01
If you have a Metronic theme and want to use it in rails or any other framework..
Copy tools to root of project
Copy src of your final selected demo to lib/src
Open tools/gulp.config.json
Paste this
{
"config": {
"path": {
"src": "../lib/src"
},
"dist": [
@milk1000cc
milk1000cc / bybit.rb
Created May 7, 2021 13:22
Ruby Bybit API Example
# https://bybit-exchange.github.io/docs/inverse/
# https://github.com/bybit-exchange/api-connectors/blob/master/encryption_example/Encryption.rb
require 'open-uri'
require 'openssl'
require 'json'
require 'bigdecimal'
require 'bigdecimal/util'
API_ENDPOINT = 'https://api.bybit.com'
@qaiserali
qaiserali / Upgrade kubectl
Last active May 2, 2024 07:06
How to upgrade kubectl on Ubuntu
## Step1: Run the below command to download the latest version of kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
## Step2: Make kubectl executable
chmod +x kubectl
## Step3: Move it to the directory where kubectl is already installed
sudo mv kubectl $(which kubectl)
@luisalima
luisalima / shoulda_cheat_model.rb
Created December 19, 2012 19:02
Shoulda model testing cheat sheet
# updated from the original @ http://cheat.errtheblog.com/s/rspec_shoulda
# just a subset -- models -- is included here. I'll update this, and create cheat sheets for others, as I go along.
# I marked the ones I added with NEW and also added the links to the corresponding code, as I think it's useful.
# Any comments/corrections are welcome!
# ================= Data and Associations =======================
# https://github.com/thoughtbot/shoulda-matchers/tree/master/lib/shoulda/matchers/active_record
it { should_not have_db_column(:admin).of_type(:boolean) }