Skip to content

Instantly share code, notes, and snippets.

View marcduiker's full-sized avatar
/-/

Marc Duiker marcduiker

/-/
View GitHub Profile
@marcduiker
marcduiker / ffmpeg_video_for_twitter.md
Last active April 7, 2024 19:35
FFmpeg command for creating video for Twitter

Convert pngs to mp4

This FFmpeg command reads images named frame_[4 char digit].png and converts it to an mp4 using the h264 encoding which Twitter accepts. The bitrate is set to 5M to reduce blocking as much as possible while keeping the size small.

ffmpeg -framerate 10 -i frame_%04d.png -c:v h264_qsv -b:v 5M video.mp4

Convert and scale an existing mp4 to 1080:

ffmpeg -i input.mp4 -c:v h264_qsv -vf: scale=1080:-1 -b:v 5M output.mp4

@marcduiker
marcduiker / recursion.md
Last active June 2, 2023 10:15
Poetry for Programmers

Recursion

function recursion() {
    // Forever repeating
    // Getting one step closer every time
    // Each iteration is a new chance
    // of getting nearer to the goal
 // Infinity won't be reached
@marcduiker
marcduiker / webmidi.html
Last active May 25, 2023 21:53
WebMidi API
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>onmidimessage</title>
<script type="module">
@marcduiker
marcduiker / MyUserManual.md
Last active January 9, 2023 08:09
My User Manual

User manual for working with me*

Conditions I like to work in

  • Usually a quiet space with little distraction.
  • A space with enough (sun)light (I use light themes in my IDE from time to time! 😱).
  • Working from home works well for me, since I have all the space and equipment I need, and I can balance it with family life.

The times and hours I like to work

@marcduiker
marcduiker / dev-boxstarter-win10.ps1
Last active October 3, 2022 14:53
This gist can be used to setup a new developer machine with features for IIS/WCF/MSMQ and various dev/ops tools.
# Usage:
# Run the folling command in cmd window or PowerShell with elevated access:
# START http://boxstarter.org/package/nr/url?<link to raw gist>
#
# Prerequisites:
# - Chocolatey
$Boxstarter.RebootOk=$true
$Boxstarter.NoPassword=$false
$Boxstarter.AutoLogin=$true
@marcduiker
marcduiker / devto_analytics.http
Last active June 29, 2022 08:37
Various dev.to analytics endpoints to get the reactions and pageviews for articles or an organization.
@apiKey=DEVTO_APIKEY
@orgId=DEVTO_ORGANIZATION_ID
@articleId=DEVTO_ARTICLE_ID
### Get historical analytics per day for an article since the given start date.
GET https://dev.to/api/analytics/historical?start=2022-05-01&article_id={{articleId}}
api-key: {{apiKey}}
### Get total (aggregate) analytics for an article.
https://dev.to/api/analytics/totals?article_id={{articleId}}
artifacts: 'flowing'
from_pipelines: 'into'
cloud: 'environments'
@marcduiker
marcduiker / xunit_fact.snippet
Last active February 6, 2022 13:15
Visual Studio C# snippet for xUnit test methods (Facts) using the naming convention proposed by http://osherove.com/blog/2005/4/3/naming-standards-for-unit-tests.html. Import the snippet using the SnippetManager in VS and type `fact[tab][tab]` inside a class to insert the snippet.
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Title>xUnit Fact</Title>
<Shortcut>fact</Shortcut>
<Description>Code snippet for an xUnit test method (Fact) following the naming convention UnitOfWork_StateUnderTest_ExpectedBehaviour.</Description>
@marcduiker
marcduiker / homework-links.md
Last active December 23, 2021 16:44
CREATE: Serverless Homework
@marcduiker
marcduiker / Update workflow and state on content items.ps1
Created May 5, 2016 23:58
Sitecore Powershell script to update the workflow and state on content items which do not have a workflow set on them.
<#
.SYNOPSIS
Updates the Workflow and Workflow state fields of content items with the given $workflowID and $workflowStateID values.
.DESCRIPTION
This script can be used when existing content is not assigned to a workflow and workflow state while it should be.
This scenario usually occurs when a workflow is assigned to a template but there is already content created based on a previous version of that template (where the workflow was not yet assigned).