Skip to content

Instantly share code, notes, and snippets.

View fitzmode's full-sized avatar

Anesu Fitz Muzenda fitzmode

View GitHub Profile
const functions = require("firebase-functions");
const admin = require("firebase-admin");
const ffmpeg_static = require("ffmpeg-static");
const { Storage } = require("@google-cloud/storage");
const path = require("path");
const storage = new Storage();
const os = require("os");
const fs = require("fs-extra");
const { ALLOWED_EXTENAMES } = require("./consts");
const { spawn } = require("child_process");
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
#!/usr/bin/env sh
VBOX_LATEST_VERSION=$(curl http://download.virtualbox.org/virtualbox/LATEST.TXT)
wget -c http://download.virtualbox.org/virtualbox/${VBOX_LATEST_VERSION}/VBoxGuestAdditions_${VBOX_LATEST_VERSION}.iso -O /tmp/VBoxGuestAdditions_${VBOX_LATEST_VERSION}.iso
sudo mkdir -p /media/guestadditions ; sudo mount -o loop /tmp/VBoxGuestAdditions_${VBOX_LATEST_VERSION}.iso /media/guestadditions
sudo /media/guestadditions/VBoxLinuxAdditions.run
sudo umount /media/guestadditions && sudo rm -rf /tmp/VBoxGuestAdditions_$VBOX_VERSION.iso /media/guestadditions
echo 'You may safely ignore the message that reads: "Could not find the X.Org or XFree86 Window System."'
@fitzmode
fitzmode / video-snapshots-sprites.sh
Created April 4, 2019 12:44 — forked from vvo/video-snapshots-sprites.sh
generate sprites of video snapshots
sudo aptitude install ffmpeg
sudo aptitude install imagemagick
# fps=1 > every seconds
ffmpeg -i video.mp4 -f image2 -vf fps=fps=1 out%d.png
# horizontal sprite, resized at 30%
convert -resize 30% +append out*.png sprite-1-sec.png
# references:
@fitzmode
fitzmode / select-text-woo-checkoutt.php
Created October 26, 2018 17:26 — forked from mchrislay/select-text-woo-checkoutt.php
Add Select Radio Buttons + Text Field option to WooCommerce Checkout Page
<?php
/**
* Outputs a rasio button form field
*/
function woocommerce_form_field_radio( $key, $args, $value = '' ) {
global $woocommerce;
$defaults = array(
'type' => 'radio',
'label' => '',
@fitzmode
fitzmode / de-assert.ts
Created April 22, 2018 06:26
Typescript type de-assertion
@ViewChild(AgmMap) myMap: AgmMap;
......
// Specific type 'de-assertion' for only this call:
.then(() => (this.myMap as any)._mapsWrapper.setCenter({lat: this.lat, lng: this.lng}));