Skip to content

Instantly share code, notes, and snippets.

View limistah's full-sized avatar
🏠
Working from home

Aleem Isiaka limistah

🏠
Working from home
View GitHub Profile
@limistah
limistah / AddCard.js
Created August 7, 2020 13:23
Card Charge - Rave Pay By Flutterwave
const inputs = require("./inputs");
const {initializeCharge} = require("./initializeCharge");
const {validateCharge} = require("./validateCharge");
const {authorizeCharge} = require("./authorizeCharge");
const {validateCharge} = require("./validateCharge");
const {verifyCharge} = require("./verifyCharge");
// 1. Initialize a charge on the card
initializeCharge(inputs.cardPayload, (err, res, body) => {
@limistah
limistah / nextTick.js
Created May 1, 2020 08:05 — forked from mmalecki/nextTick.js
process.nextTick vs setTimeout(fn, 0)
for (var i = 0; i < 1024 * 1024; i++) {
process.nextTick(function () { Math.sqrt(i) } )
}
const start = Date.now();
const today = new Date().toISOString();
console.log({today});
console.log({start})
setTimeOut(function(){
const end = Date.now();
console.log({setTimeOutTook: (end - start) / 1000 });
@limistah
limistah / apiMiddlewareDspatcher.js
Last active April 19, 2020 05:31
Redux API Middleware Action Dispatcher
const noop = () => {};
export default (
dispatch = noop,
action = {},
success = noop,
error = noop,
preProcess = noop
) => {
const apiAction = dispatch(action);
if (apiAction.then) {
@limistah
limistah / index.html
Created March 15, 2020 07:32
Hello World CSS
<html>
<head>
<link href="./program.css" rel="stylesheet" />
</head>
<body>
<div class="app"> </div>
</body>
@limistah
limistah / App.js
Last active September 5, 2021 16:39
ReactJS InplaceEdit component and consumption
import InplaceEdit from "./InplaceEdit"
class App extends React.Component {
render() {
return (
<InplaceEdit
isUpdatingId={true || false}
id={idForTheField || ""}
updateKey={keyToReturnAnObjectWith || ""}
onUpdate={functionToCallForTheUpdate || (() => {})}
version: 2
jobs:
staging:
docker:
- image: circleci/node:10
steps:
- run:
name: Deploy API
command: ssh -o "StrictHostKeyChecking no" api@staging.datingkinky.com "cd ~/app; git pull; yarn install --production; sudo systemctl restart dkapi"
@limistah
limistah / reboot-server.sh
Created August 5, 2019 12:59
Reboot a unix machine
sudo reboot
@limistah
limistah / copy pub ssh key.sh
Created August 5, 2019 12:39
Copy public ssh key file to the clipboard
xclip -sel clip < ~/.ssh/id_rsa.pub
@limistah
limistah / open_lightsail_auth_keys_file.sh
Created August 5, 2019 12:31
Open lightsail authorized keys file for editing
sudo nano ~/.ssh/authorized_keys