Skip to content

Instantly share code, notes, and snippets.

View davatron5000's full-sized avatar
๐Ÿš€
Making Luro

Dave Rupert davatron5000

๐Ÿš€
Making Luro
View GitHub Profile
@PaulKinlan
PaulKinlan / canvasrecord.js
Last active May 7, 2024 04:04
Screen recorder in JS
(function() {
let canvas = document.querySelector('canvas');
// Optional frames per second argument.
let stream = canvas.captureStream(25);
var options = {mimeType: 'video/webm; codecs=vp9'};
let recorder = new MediaRecorder(stream, options);
let blobs = [];
function download(blob) {
var url = window.URL.createObjectURL(blob);

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg
export async function getUser(token: string) {
const headers = new Headers();
const bearer = "Bearer " + token;
headers.append("Authorization", bearer);
const options = {
method: "GET",
headers: headers
};
const graphEndpoint = "https://graph.microsoft.com/beta/me";
@zachleat
zachleat / .eleventy.js
Last active March 21, 2020 02:11
Eleventy + Vue Preview
const eleventyVue = require("@11ty/eleventy-plugin-vue");
module.exports = function(eleventyConfig) {
// Use Defaults
eleventyConfig.addPlugin(eleventyVue);
// OR, Use your own options
eleventyConfig.addPlugin(eleventyVue, {
// Directory for single file components (defaults to includes folder)
componentsDirectory: "",