This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
await Category.aggregate([ | |
{ | |
$lookup: { | |
from: 'articles', | |
as: 'article', | |
let: { indicator_id: '$_id' }, | |
pipeline: [ | |
{ | |
$match: { | |
$expr: { $eq: ['$category', '$$indicator_id'] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
NewerOlder