Skip to content

Instantly share code, notes, and snippets.

View iamnasirudeen's full-sized avatar
🎯
Busy

Nasirudeen Olohundare iamnasirudeen

🎯
Busy
View GitHub Profile
@iamnasirudeen
iamnasirudeen / gist:209296e370b0ce95decd374eb09d2f37
Created January 17, 2019 05:53 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
// paystack
function payWithPaystack() {
let amn = $('#amount').val();
var handler = PaystackPop.setup({
key: 'pk_test_1e3282537643fce3a4066e7fe82e89198cd5cf4a',
email: $("#email").val(),
amount: amn * 100,
currency: "NGN",
channels: ['card', 'bank'],
@iamnasirudeen
iamnasirudeen / watermark.js
Created March 3, 2019 20:35 — forked from suissa/watermark.js
Add watermark with Node.js and ffmpeg
var ffmpeg = require('ffmpeg');
try {
var process = new ffmpeg('example.mp4');
process.then(function (video) {
console.log('The video is ready to be processed');
var watermarkPath = 'watermark-suissa.png',
newFilepath = './video-com-watermark.mp4',
settings = {
position : "SE" // Position: NE NC NW SE SC SW C CE CW
module.exports = function(io){
const express = require('express');
const router = express.Router();
router.get('/', (req, res, next) => {
io.emit('welcome', 'Welcome to our website)
)
}
// So the question is i can emit using io (but io will make it global, i.e all connected sockets will receive this message, but i only want the new ly connected socket to receive the message)
const express = require('express');
const bodyparser = require('body-parser');
var arDrone = require('ar-drone');
const router = express.Router();
const app = express();
const commands = ['takeoff', 'land','up','down','goleft','goright','turn','goforward','gobackward','stop'];
var drone = arDrone.createClient();
// disable emergency
drone.disableEmergency();
var async = require('async');
// Send email
var sendEmail = function(email,callback) {
console.log("Sending email to "+email);
callback(null);
}
// create a queue object with concurrency 2
var q = async.queue(sendEmail,2);
@iamnasirudeen
iamnasirudeen / paystack.js
Created July 10, 2019 16:04
Paystack recurring payment
import axios from 'axios';
const createCustomer = async form => {
const options = {
url: "https://api.paystack.co/customer",
headers: {
'authorization': `Bearer ${process.env.PAYSTACK_SECRET_KEY}`,
'content-type': 'application/json',
'cache-control': 'no-cache'
},
await Category.aggregate([
{
$lookup: {
from: 'articles',
as: 'article',
let: { indicator_id: '$_id' },
pipeline: [
{
$match: {
$expr: { $eq: ['$category', '$$indicator_id'] }
@iamnasirudeen
iamnasirudeen / medium_clap.html
Created September 20, 2019 16:07 — forked from JonathanDn/medium_clap.html
Medium Clap Reproduction - My take on it by looking, researching and trial & error. Demo available --> https://jsfiddle.net/urft14zr/425/
<div class="canvas">
<div id="totalCounter" class="total-counter"></div>
<div id="clap" class="clap-container">
<i class="clap-icon fa fa-hand-paper-o"></i>
</div>
<div id="clicker" class="click-counter">
<span class="counter"></span>
</div>
@extends('admin.layouts.app')
@section('content')
<div class="container-fluid" id="menu-app" data-id="{{$row->id ?? ''}}" v-cloak>
<div class="d-flex justify-content-between mb20">
<h1 class="title-bar">
@if(!empty($row->id))
{{__("Edit Menu:")}} @{{name}}
@else
{{__('Create new menu')}}