Skip to content

Instantly share code, notes, and snippets.

Avatar
🏢
Building our next big thing.

Jonas Nordlund jonasnordlund

🏢
Building our next big thing.
View GitHub Profile
@jonasnordlund
jonasnordlund / TranscodeToAC3.bat
Created May 14, 2022
Transcode any audio track to AC3
View TranscodeToAC3.bat
rem Transcodes any audio track to AC3 while retaining video as-is.
rem Dedicated to the poor bastards with decoders not supporting the
rem ever more popular Dolby Digital Plus codec.
ffmpeg -i "INPUT" -map 0 -c:v copy -c:a ac3 -c:s copy "OUTPUT"
@jonasnordlund
jonasnordlund / Microsoft.PowerShell_profile.ps1
Last active Feb 13, 2022
My PowerShell Core profile. Random quote, green/red prompt depending on admin rights, cleaner path for Registry / UNC.
View Microsoft.PowerShell_profile.ps1
Import-Module Terminal-Icons
function prompt
{
$identity = [Security.Principal.WindowsIdentity]::GetCurrent()
$principal = [Security.Principal.WindowsPrincipal] $identity
$adminRole = [Security.Principal.WindowsBuiltInRole]::Administrator
$ESC = [char]27
$promptColor = $principal.IsInRole($adminRole) ? "$ESC[91m" : "$ESC[92m"
@jonasnordlund
jonasnordlund / Downlink.ps1
Created Dec 31, 2019
Downloads a list of URI's.
View Downlink.ps1
@jonasnordlund
jonasnordlund / FormatAspNetDate.js
Created May 3, 2017
Format ASP .NET web service dates.
View FormatAspNetDate.js
/**
* @description Although Microsoft have improved this situation with Web API,
ASP .NET applications still return JSON dates in a proprietary
format similar to "/Date(1320825600000-0800)/". This function
parses these dates into a user locale depending date string.
* @param {string} s The ASP .NET date to parse and format.
* @returns {string} The formatted date.
*/
aspNetDate: function (s) {
var dateParts = s.match(/\/Date\((\d+)[+-](\d+)\)\//);
@jonasnordlund
jonasnordlund / PSTransfer.ps1
Created Apr 6, 2017
Transfer files over FTP/HTTP with piping support using Powershell
View PSTransfer.ps1
<#
.SYNOPSIS
Transfers files over HTTP or FTP.
.DESCRIPTION
Downloads or uploads files over HTTP or FTP. Supports user authentication and piped file names.
.PARAMETER UserName
The user account name or an anonymous connection if missing.
.PARAMETER Password
The user account password.
.PARAMETER FileName