Skip to content

Instantly share code, notes, and snippets.

@magnusbae
magnusbae / ff-mpeg-goodies.md
Last active May 23, 2022 07:50
FFmpeg goodies - useful FFmpeg commands with examples

Various useful FF-MPEG commands

Export keyframes from video at intervals

Seconds: time for i in {0..42} ; do ffmpeg -accurate_seek -ss `echo $i.0 | bc` -i input.mp4 -frames:v 1 period_down_$i.jpg ; done

Minutes: time for i in {0..42} ; do ffmpeg -accurate_seek -ss `echo $i*60.0 | bc` -i input.mp4 -frames:v 1 period_down_$i.jpg ; done

@magnusbae
magnusbae / remove-win-10-apps.md
Last active November 12, 2018 06:26
How to remove Windows 10 Apps (eg. "Photos")

How to remove Windows 10 Apps (eg. "Photos")

Open PowerShell (right click > run as Administrator), and enter Get-AppxPackage *photo* | Remove-AppxPackage For other apps just replace "photo" with something else.

If you want to look at the list of installed applications just use Get-AppxPackage, if you want to copy said list into a program better suited for working with text (eg. has search), just type Get-AppxPackage | clip

  • E0A = No special edition
  • 0GG = Emission standard EU4
  • 4UF = Drivers and front passenger air bag with front passenger air bag deactivation
  • 6XD = Exterior mirrors: electrically adjustable/heated
  • 5SL = Left exterior mirror: aspherical
  • 5RU = Right exterior mirror: convex (large viewing field)
  • 1KD = Disc brakes, rear
  • J0Z = Battery 520 A (110 Ah)
  • 1LG = Disc brakes, front
  • 1BA = Standard suspension/shock absorption
@magnusbae
magnusbae / Action Creators
Last active August 29, 2015 14:23
WebStorm templates for JSX-files
var Dispatcher = require('../dispatcher/AppDispatcher'),
ActionTypes = require('../constants/ActionConstants').ActionTypes;
module.exports = {
someAction: function (data) {
Dispatcher.dispatch({
type: ActionTypes.SOME_ACTION_TYPE,
data: data
});
}
@magnusbae
magnusbae / Install nano in msysgit.md
Last active August 24, 2018 17:20
Install script and manual instructions for nano + msysgit

#How to install the 'nano' text editor in msysgit

Adapted from https://vijayparsi.wordpress.com/2012/03/07/nano-with-mingw32-for-msysgit/


#Fast and simple install Run msysgit as administrator and copy and paste (insert-key) the following line, press enter. It will execute the install_nano.sh script found at the bottom of this file. If you prefer to install nano manually, the process is described below.

/*
* revolve_can_definitions.h
*
* Created: 20.01.2013 18:47:51
* Author: Bruker
*/
#ifndef REVOLVE_CAN_DEFINITIONS_H_
#define REVOLVE_CAN_DEFINITIONS_H_
@magnusbae
magnusbae / git-stop-tracking-remote-branch.md
Created April 8, 2014 20:05
How to make Git stop track a remote branch without deleting the remote branch.

You don't have to delete your local branch.

Simply delete your remote tracking branch:

git branch -d -r origin/<remote branch name> (This will not delete the branch on the remote repo!)

See "Having a hard time understanding git-fetch"

there's no such concept of local tracking branches, only remote tracking branches.

@magnusbae
magnusbae / .bash_profile
Last active December 29, 2015 15:29
My mac bash profile
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
export PATH="$HOME/bin:$PATH"
# Git branch in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \W\[\033[31m\]\$(parse_git_branch)\[\033[00m\]\n$ "