This file contains hidden or 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
/* | |
1. Go to https://accounts.snapchat.com/ and request download of your data. | |
2. Download zip-file (when ready) and locate json/memories_history.json | |
3. Create a new folder with this script and the memories_history.json file | |
4. Install node-fetch; npm install node-fetch@^2.6.6 (using older version to avoid having to import as module) | |
5. Run the script. | |
Files will be prefixed with the date and a unique ID (from Snapchat) to avoid overwriting (see more details below). | |
This script was originally inspired by this StackOverflow question (but has since diverged greatly); https://stackoverflow.com/questions/61058637/snapchat-download-all-memories-at-once |
This file contains hidden or 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
(?<="value": ")[^"]+(?=") | |
https://stackoverflow.com/questions/43577528/visual-studio-code-search-and-replace-with-regular-expressions | |
https://regex101.com/r/7J06ki/1 |
This file contains hidden or 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
<?php | |
$scripts = preg_grep('~\.(js)$~', scandir(__DIR__. '/../react-frontend/build/static/js')); | |
foreach($scripts as $script){ | |
wp_enqueue_script("react-{$script}", plugin_dir_url( __FILE__ ). "./../react-frontend/build/static/js/{$script}"); | |
} | |
echo "<div id="root">Enabled JavaScript to see this page</div>"; | |
?> |
This file contains hidden or 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 React, { useState, useEffect } from 'react'; | |
export default ({ id = null, timeout = 15000, children, onReady, apiKey }) => { | |
/* To-do: Add support for auto generated id */ | |
// const [ stateId ] = useState((id === null) ? `gmap-${new Date().valueOf()}` : id); | |
useEffect(() => { | |
let mapsUrl = `https://maps.google.com/maps/api/js?key=${apiKey}`; | |
let allBodyScripts = Array.from(document.getElementsByTagName('script')); | |
let exists = allBodyScripts.find(item => item.src === mapsUrl); | |
if(!exists){ |
This file contains hidden or 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
<?php | |
/* | |
Plugin Name: Netlify Build | |
Description: Runs a Netlify build when saving | |
Author: Steffen Martinsen | |
Version: 0.0.1 | |
*/ | |
defined('ABSPATH') or die(); |
This file contains hidden or 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
# Converts video (2 pass) with 15 fps @ 500kbs without audio (ideal for web) - http://trac.ffmpeg.org/wiki/Encode/VP9 | |
# Run both lines | |
ffmpeg -i input.mp4 -framerate 15 -c:v libvpx-vp9 -b:v 500k -pass 1 -an -f webm /dev/null && \ | |
ffmpeg -i input.mp4 -framerate 15 -c:v libvpx-vp9 -b:v 500k -pass 2 -an output.webm | |
# Converts audio to OGG (96 kb/s) https://superuser.com/questions/1121334/how-to-use-ffmpeg-to-encode-ogg-audio-files | |
ffmpeg -i input.aif -c:a libvorbis -b:a 96k output.ogg | |
#Converts audio to MP3 (96 kb/s) https://trac.ffmpeg.org/wiki/Encode/MP3 | |
ffmpeg -i input.aif -c:a libmp3lame -b:a 96k output.mp3 |