Skip to content

Instantly share code, notes, and snippets.

View siggiarni's full-sized avatar

Sigurður Árni Svanbergsson siggiarni

View GitHub Profile
@siggiarni
siggiarni / nth-last-child.css
Last active October 1, 2021 22:45
Style a penultimate child in CSS thanks to the power of nth-last-child:
ul li:nth-last-child(2) {
...
}
  • -ms- Microsoft
  • mso- Microsoft Office
  • -moz- Mozilla Foundation (Gecko-based browsers)
  • -o-, -xv- Opera Software
  • -atsc- Advanced Television Standards Committee
  • -wap- The WAP Forum
  • -webkit- Safari, Chrome (and other WebKit-based browsers)
  • -khtml- Konqueror browser
  • -apple- Webkit supports properties using the -apple- prefixes as well
  • prince- YesLogic
{"lastUpload":"2021-02-10T13:11:15.534Z","extensionVersion":"v3.4.3"}
@siggiarni
siggiarni / ffmpeg.md
Created January 26, 2020 08:29 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris semper quam eu mauris molestie, vitae tempus nunc venenatis. Sed ut quam luctus, congue velit sit amet, vulputate sem. Maecenas sagittis tortor ut mattis euismod. Proin ac dolor neque. Praesent nec fringilla nunc, et sagittis dolor. Sed fringilla sed quam ut tristique. Donec aliquet consequat turpis, in pharetra metus rhoncus sed. Integer erat turpis, gravida vitae quam a, mollis commodo lorem. Integer consectetur diam nunc, a porta tellus consequat eget. Ut mattis ex vitae ante aliquet, a pulvinar ligula tincidunt. Vestibulum enim nisi, placerat aliquet placerat vel, condimentum non est.

https://github.com/Homebrew/homebrew-cask/issues/58046
/usr/bin/find "$(brew --prefix)/Caskroom/"*'/.metadata' -type f -name '*.rb' -print0 | /usr/bin/xargs -0 /usr/bin/sed -i '' '/depends_on macos:/d'
@siggiarni
siggiarni / fix-homebrew-npm.md
Last active November 18, 2018 21:51 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.

@siggiarni
siggiarni / LESS.sublime-settings
Last active November 9, 2018 10:15
Misc Sublime text settings
// Sublime menu > Preferences > Package Settings > LESS > Settings - User
{
"extensions":
[
"less.css"
]
}
# Setting the prefix from C-b to C-a
set -g prefix C-a
# Free the original Ctrl-b prefix keybinding
unbind C-b
#setting the delay between prefix and command
set -s escape-time 1
# Set the base index for windows to 1 instead of 0
tell application "SystemUIServer"
display dialog "Try pasting now" default answer ""
end tell