Skip to content

Instantly share code, notes, and snippets.

@kinsomicrote
kinsomicrote / README.md
Created April 28, 2023 17:46 — forked from masterT/README.md
RequestForgeryProtection for ActionController::API

Configure ActionController::RequestForgeryProtection for an ApplicationController that does not inherits from ActionController::Base (or any controller that does not include ActionController::RequestForgeryProtection).

This is required since the module is included after the application is loaded, so it does not get configured automatically by the configuration files config/environments/*.rb.

@kinsomicrote
kinsomicrote / banks.json
Created April 10, 2023 20:51 — forked from LordGhostX/banks.json
List of Nigerian Banks and Codes
{
"Access Bank": "044",
"Access Bank (Diamond)": "063",
"ALAT by WEMA": "035A",
"ASO Savings and Loans": "401",
"Bowen Microfinance Bank": "50931",
"CEMCS Microfinance Bank": "50823",
"Citibank Nigeria": "023",
"Ecobank Nigeria": "050",
"Ekondo Microfinance Bank": "562",
@kinsomicrote
kinsomicrote / tinymce-react-nextjs.md
Created January 18, 2021 13:18 — forked from zhangshine/tinymce-react-nextjs.md
NextJs- React - Self hosted TinyMCE
  1. Install (TinyMCE 5.x)
npm install --save tinymce @tinymce/tinymce-react copy-webpack-plugin
  1. Copy static files(tinymce skins) to public folder. Edit file next.config.js
const path = require('path');
const webpack = require('webpack');
const CopyPlugin = require('copy-webpack-plugin');
require 'httparty'
class TransactionsController < ApplicationController
def paystack
@order = Order.find_by(ref_no: params[:ref])
amount = @order.price
ref = @order.ref_no
@kinsomicrote
kinsomicrote / rails http status codes
Created November 18, 2019 19:14 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@kinsomicrote
kinsomicrote / ngrok-installation.md
Created October 24, 2019 15:39 — forked from wosephjeber/ngrok-installation.md
Installing ngrok on Mac

Installing ngrok on OSX

brew cask install ngrok

Using ngrok

The easiest way to use ngrok to tunnel into your localhost is if your local project is running on a specific port (e.g. not using named vhosts). You just run ngrok http [port number].

You can quickly boot up a local webserver using ruby. cd into the project's root directory and run ruby -run -e httpd . -p [port number].

@kinsomicrote
kinsomicrote / HOC.js
Created March 2, 2018 03:53 — forked from Restuta/HOC.js
React HOC (Higher Order Component) Example
/* HOC fundamentally is just a function that accepts a Component and returns a Component:
(component) => {return componentOnSteroids; } or just component => componentOnSteroids;
Let's assume we want to wrap our components in another component that is used for debugging purposes,
it just wraps them in a DIV with "debug class on it".
Below ComponentToDebug is a React component.
*/
//HOC using Class
//it's a function that accepts ComponentToDebug and implicitly returns a Class
let DebugComponent = ComponentToDebug => class extends Component {
@kinsomicrote
kinsomicrote / capybara cheat sheet
Created June 8, 2016 12:32 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')