Skip to content

Instantly share code, notes, and snippets.

const fs = require('fs')
const ffmpeg = require('fluent-ffmpeg')
const path = require('path')
const FRAMES_PER_SECOND = 30
const framesFolder = path.resolve('myfolder', 'videos', 'frames')
function getAllFilesFromFolder(folderPath, extension) {
return new Promise((resolve, reject) => {
@HTMLGuyLLC
HTMLGuyLLC / SharingEnvVarsUbuntuNginx.md
Last active December 11, 2021 15:47
Sharing Environment Variables between Ubuntu users and Nginx

Sharing Environment Variables Between your Ubuntu user, and Nginx.

Environment: Ubuntu 16.04, Nginx 1.10.3

Step 1

Append the following to your site's .gitignore file so that you don't accidentally commit your environment variables.

/.env
/.env.nginx
@Beasta
Beasta / fullCalendarIframe.html
Created May 16, 2017 01:02
Basic Google Calendar integration for fullcalendar
<link href="//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.4.0/fullcalendar.min.css" rel="stylesheet">
<link href="//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.4.0/fullcalendar.print.css" rel="stylesheet" media="print">
<script src="https://momentjs.com/downloads/moment.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script type='text/javascript' src='//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.4.0/fullcalendar.min.js'></script>
<script type='text/javascript' src='//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.4.0/gcal.min.js'></script>
<script type='text/javascript'>
// posting this because the following is a poor example https://fullcalendar.io/docs/google_calendar/
// This was used to wrap google calendar in squarespace and make it look tremendously better
$(document).ready(function() {
@zburgermeiszter
zburgermeiszter / linux-fake-webcam-loop.sh
Created December 29, 2015 21:48
Loop video file as fake webcam device with ffmpeg
ffmpeg -re -f concat -i <(for i in {1..9999}; do printf "file '%s'\n" input.mp4; done) -f v4l2 /dev/video1 && !!
@mhawksey
mhawksey / quickstart.html
Created October 2, 2015 15:24
Google Sheets as a Database – Authenticated INSERT with Apps Script using Execution API - Working Example
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<title>Google Sheets as a Database – Authenticated INSERT with Apps Script using Execution API - Working Example</title>
<script type="text/javascript">
// Your Client ID can be retrieved from your project in the Google
// Developer Console, https://console.developers.google.com
var CLIENT_ID = '<INSERT_YOUR_CLIENT_ID>';
var SCRIPT_ID = '<INSERT_YOUR_SCRIPT_ID>';
@derekconjar
derekconjar / wordpress-firebase.php
Last active April 25, 2024 15:21
An example of using Firebase and WordPress together. The idea is to use WP's custom post types and metaboxes to make content management easy, and sync with Firebase so that your websites have access to a real-time JSON feed of your custom data.
<?php
/**
* All custom functions should be defined in this class
* and tied to WP hooks/filters w/in the constructor method
*/
class Custom_Functions {
// Custom metaboxes and fields configuration