Skip to content

Instantly share code, notes, and snippets.

View harrisjose's full-sized avatar
🏡
Working from home

Harris harrisjose

🏡
Working from home
View GitHub Profile
@harrisjose
harrisjose / [token].js
Created August 20, 2021 15:13
Telegram bot using Next.js API Routes
import Cors from 'micro-cors'
import got from 'got'
import { format } from 'date-fns'
import { isEmpty, makeYaml } from 'utils'
const getContent = (message) => {
let { entities, text } = message
// Get url for the note
let urlEntity = entities.find((e) => e.type === 'url')
@harrisjose
harrisjose / Debouncer.js
Created September 5, 2019 05:45
RAF based debounce from github.com/WickyNilliams/headroom.js
window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;
/**
* Handles debouncing of events via requestAnimationFrame
* @see http://www.html5rocks.com/en/tutorials/speed/animations/
* @param {Function} callback The callback to handle whichever event
*/
function Debouncer (callback) {
this.callback = callback;
this.ticking = false;
var gulp = require('gulp')
var minify = require('gulp-minify')
var minifyCSS = require('gulp-minify-css')
var watch = require('gulp-watch')
var server = require('gulp-server-livereload')
var remove = require('rimraf')
var exec = require('exec-chainable')
gulp.task('clean', function () {
return remove('./dist', function () {