Skip to content

Instantly share code, notes, and snippets.

@pezcode
pezcode / ffmpeg_vid2gif.ps1
Last active May 16, 2020 00:56
FFmpeg: convert video to animated .gif (PowerShell script)
# convert video to animated .gif
# requires FFmpeg 2.6 or higher
# http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
param(
[Parameter(Mandatory=$true)][string]$InputPath,
[string]$OutputPath,
[int]$Height=0 # 0 for input height
)
@pezcode
pezcode / ffmpeg_extract.ps1
Last active March 5, 2018 04:41
FFmpeg: cut video without re-encoding (PowerShell script)
# cut video without re-encoding
# syntax for start and end times:
# http://ffmpeg.org/ffmpeg-utils.html#time-duration-syntax
param(
[Parameter(Mandatory=$true)][string]$InputPath,
[Parameter(Mandatory=$true)][string]$OutputPath,
[string]$StartTime="0",
[string]$EndTime="99:59:59.99"
@pezcode
pezcode / lyne_unlock.py
Created January 14, 2018 14:34
Unlock all LYNE (http://www.lynegame.com/) levels on the Windows version. I needed this after reformatting Windows since the game didn't have Steam Cloud sync.
import sys
import _winreg
# windows savegame location:
# HKCU/Software/Thomas Bowker/LYNE
def main():
sets = 26 # A-Z
levels = 25
for s in range(sets):
@pezcode
pezcode / facebook_volume.user.js
Last active January 14, 2018 14:46
Stop Facebook from maxing out your video volume. Slightly modified version of the original script by Daile Alimo: https://gist.github.com/JustDaile/478a4e1e07003648865984ede307093d. Modified to use local storage since I couldn't get it to work using cookies. Tested with Firefox 57 and Violentmonkey 2.8.24.
// ==UserScript==
// @name FBVVM
// @namespace http://tampermonkey.net/
// @version 1.1
// @description Maintains set volume of videos on play of native video links on Facebook.
// @author Daile Alimo, pezcode
// @match https://www.facebook.com/*
// @grant none
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
@pezcode
pezcode / iolog.h
Created January 14, 2018 14:58
simple C++ iostream log
#pragma once
#include <ostream>
#include <fstream>
using namespace std;
class Log
{
typedef std::ostream& (*ostream_manipulator)(std::ostream&);
@pezcode
pezcode / ShooterUI.ini
Last active January 14, 2018 15:18
Talespin's Dirty Bomb 1080p custom HUD (https://i.imgur.com/WqLCQaR.jpg)
[ShooterGame.SGUIHUDPlayer]
MinimapPosition=(Align=(H=HA_LEFT, V=HA_BOTTOM), Attach=(H=HA_LEFT, V=HA_BOTTOM, HA="", VA=""), PixelOffset=(X=450, Y=0))
ObituaryMessageLogPosition=(Attach=(H=HA_RIGHT, V=HA_CENTER))
WeaponAmmoPosition=(Align=(H=HA_RIGHT, V=HA_BOTTOM), Attach=(H=HA_RIGHT, V=HA_BOTTOM, HA="", VA=""), PixelOffset=(X=420, Y=170), ShadowOffset=(X=-1, Y=-1))
AbilityCooldownPosition=(Align=(H=HA_RIGHT, V=HA_BOTTOM), Attach=(H=HA_RIGHT, V=HA_BOTTOM, HA="", VA=""), PixelOffset=(X=330, Y=35), ShadowOffset=(X=-1, Y=-1))
PlayerHealthPosition=(Align=(H=HA_LEFT, V=HA_BOTTOM), Attach=(H=HA_LEFT, V=HA_BOTTOM, HA="", VA=""), PixelOffset=(X=580, Y=175))
GameWaveTimerPosition=(Attach=(H=HA_CENTER, V=HA_BOTTOM), PixelOffset=(Y=166, X=-55))
@pezcode
pezcode / ShooterUI.ini
Last active January 14, 2018 15:18
1440p version of Talespin's Dirty Bomb HUD, with some slight modifications (https://i.imgur.com/CsqTU9n.jpg)
[ShooterGame.SGUIHUDPlayer]
ChatInputPosition=(Align=(H=HA_LEFT, V=HA_BOTTOM), Attach=(H=HA_LEFT, V=HA_TOP,VA="Minimap"), PixelOffset=(X=50))
MinimapPosition=(Align=(H=HA_LEFT,V=HA_TOP),Attach=(H=HA_LEFT,V=HA_BOTTOM,HA="PlayerHealth",VA="PlayerHealth"),PixelOffset=(X=0,Y=-50))
ObituaryMessageLogPosition=(Align=(H=HA_RIGHT,V=HA_BOTTOM),Attach=(H=HA_RIGHT,V=HA_TOP,VA="Minimap"),PixelOffset=(X=150))
ExpCounterPosition=(Align=(H=HA_CENTER, V=HA_TOP), Attach=(H=HA_CENTER, V=HA_CENTER), PixelOffset=(Y=75), ShadowOffset=(X=-1, Y=-1))
WeaponAmmoPosition=(Align=(H=HA_LEFT,V=HA_TOP),Attach=(H=HA_CENTER,V=HA_TOP,VA="PLAYERHEALTH"),PixelOffset=(X=100,Y=0),ShadowOffset=(X=-1,Y=-1))
AbilityCooldownPosition=(Align=(H=HA_RIGHT,V=HA_TOP),Attach=(H=HA_RIGHT,V=HA_BOTTOM,HA="WeaponAmmo",VA="WeaponAmmo"),PixelOffset=(X=0,Y=-50),ShadowOffset=(X=-1,Y=-1))
PlayerHealthPosition=(Align=(H=HA_RIGHT,V=HA_BOTTOM),Attach=(H=HA_CENTER,V=HA_BOTTOM),PixelOffset=(X=-100,Y=250),ShadowOffset=(X=-1,Y=-1))
GameWaveTimerPosition=(Align=(H=HA_LEFT,
@pezcode
pezcode / db-backup.ps1
Created January 14, 2018 15:25
Restores common Dirty Bomb settings after an update or a fresh install.
$backupfolder = 'backup'
$files = 'ShooterGame.ini', 'ShooterInput.ini', 'ShooterUI.ini', 'ShooterEngine.ini'
ForEach($file in $files) {
$backupfile = "$backupfolder\$file"
New-Item $backupfile -Force
Copy-Item $file $backupfile
}
@pezcode
pezcode / batch_hue_shift.py
Created February 3, 2018 23:38
GIMP plugin script to hue-shift an image several times (e.g. for animations)
#!/usr/bin/env python
from gimpfu import *
from gimpenums import *
import os
def batch_hue_shift(image, drawable, count, outdir):
assert 2 <= count <= 360
folder, filename = os.path.split(image.filename)
@pezcode
pezcode / ffmpeg_2mp4.ps1
Created March 5, 2018 04:44
FFmpeg: convert video to .mp4 (PowerShell script)
# convert video to .mp4 (x264)
# copies audio stream
param(
[Parameter(Mandatory=$true)][string]$InputPath,
[string]$OutputPath,
[int]$Height=0, # 0 for input height
[switch]$Fast=$false
)