Skip to content

Instantly share code, notes, and snippets.

View iamnasirudeen's full-sized avatar
🎯
Busy

Nasirudeen Olohundare iamnasirudeen

🎯
Busy
View GitHub Profile
http://stackoverflow.com/questions/12168452/long-lasting-fb-access-token-for-server-to-pull-fb-page-info/21927690#21927690
Having found that it is possible to generate a Facebook Page Access Token that does not expire (with help from @Igy), here is a clear, step-by-step quide for all those looking to the same:
1. Make sure you are the admin of the FB page you wish to pull info from
2. Create a FB App (should be with the same user account that is the page admin)
3. Head over to the Facebook Graph API Explorer
4. On the top right, select the FB App you created from the "Application" drop down list
5. Click "Get Access Token"
6. Make sure you add the manage_pages permission
@iamnasirudeen
iamnasirudeen / nextjs-hoc-authorization.js
Created April 28, 2021 20:37 — forked from whoisryosuke/nextjs-hoc-authorization.js
ReactJS - NextJS - A HOC for wrapping NextJS pages in an authentication check. Checks for getInitialProps on the child component and runs it, so you still get SSR from the page. Also includes a user agent for Material UI.
import React, {Component} from 'react'
import Router from 'next/router'
import AuthService from './AuthService'
export default function withAuth(AuthComponent) {
const Auth = new AuthService('http://localhost')
return class Authenticated extends Component {
static async getInitialProps(ctx) {
// Ensures material-ui renders the correct css prefixes server-side

Direct copy of pre-encoded file:

$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8

@iamnasirudeen
iamnasirudeen / nextTick.js
Created June 14, 2020 12:34 — forked from limistah/nextTick.js
process.nextTick vs setTimeout(fn, 0)
for (var i = 0; i < 1024 * 1024; i++) {
process.nextTick(function () { Math.sqrt(i) } )
}
@iamnasirudeen
iamnasirudeen / redincredid.ctrl.js
Created February 3, 2020 08:53 — forked from kosson/redincredid.ctrl.js
This is how content data generated by Editor.js could be transformed back into html.
const resursaModel = require('../../models/resursa-red');
const competenteS = require('../../models/competenta-specifica');
module.exports = (params) => {
return resursaModel.find({_id: params.idres}).populate({
path: 'competenteS'
}).exec().then( (resursa) => {
// console.log(resursa);
if (resursa[0].content) {
let articleHTML = '';
resursa[0].content.blocks.map(obj => {
@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>
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);
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();
@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
@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