Skip to content

Instantly share code, notes, and snippets.

View extratone's full-sized avatar
🗿
sudo exit

David Blue extratone

🗿
sudo exit
View GitHub Profile
@Lego2012
Lego2012 / ipad-orientation.html
Last active September 21, 2022 14:47
iPad Orientation
<style>
@media only screen and (max-device-width: 1024px) and (orientation:portrait) {
.landscape { display: none; }
}
@media only screen and (max-device-width: 1024px) and (orientation:landscape) {
.portrait { display: none; }
}
</style>
<h1 class="portrait">Your device orientation is "portrait"<h1>
@jamesmacwhite
jamesmacwhite / ffmpeg_mkv_mp4_conversion.md
Last active March 18, 2025 03:08
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
@joshvc
joshvc / CSS for live.fiawec.com Timing Tweaks.md
Last active June 15, 2024 18:59
More cars, less wasted space on WEC Timing

FIA WEC Timing Screen Tweaks

This is my data maximization CSS for the Stylish Chrome extension. I'm using it to Airplay two browsers side-by-side to a 39" TV (see comment below), so your application may need some tweaks.

To use, install the extension then visit live.fiawec.com. Click the Stylish icon, and choose "Write style for live.fiawec.com/this_URL". Then paste in the your preferred version of the css in the edit window (see photos of the two versions in the comments below), press save, and the page will automaticaly refresh.

The biggest change can be made just with the font size. You'll want to adjust that based on your screen and viewing distance.

If things are too crowded, adjust the padding inside the #classement td. 5px looks better, but space is precious.

@ecstasy2
ecstasy2 / update-status.sh
Created May 18, 2016 12:25
Bash script to update github commit status
#!/bin/bash
set -e
# Usage: ./update-status.sh --sha=somesha \
# --repo=edyn/service-identity \
# --status=pending \
# --message="Starting tests" \
# --context=edyn/e2e \
# --url=http://something.com
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active April 18, 2025 13:48
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@omz
omz / Barcode Scanner.py
Created February 19, 2016 00:36
Barcode Scanner.py
# coding: utf-8
# Barcode scanner demo for Pythonista
# Based on http://www.infragistics.com/community/blogs/torrey-betts/archive/2013/10/10/scanning-barcodes-with-ios-7-objective-c.aspx
from objc_util import *
from ctypes import c_void_p
import ui
import sound
found_codes = set()
@philgruneich
philgruneich / New from Gist.py
Created January 30, 2016 15:39
Adds Python gists to Pythonista.
# coding: utf-8
# This script downloads and opens a Gist from a URL in the clipboard.
# It's meant to be put in the editor's actions menu.
#
# It works with "raw" and "web" gist URLs, but not with gists that
# contain multiple files or non-Python files.
#
# If a file already exists, a dialog is shown that asks whether the
# new file should be renamed or replaced.
@viticci
viticci / YouTubeRSS.py
Created January 21, 2016 21:41
YouTubeRSS.py
from bs4 import BeautifulSoup
import urllib2
import appex
import dialogs
import clipboard
channel = appex.get_url()
webpage = urllib2.urlopen(channel)
soup = parser(webpage)
@hluk
hluk / CopyQ - Synchronize Clipboard with Other Sessions.ini
Created December 21, 2015 10:00
CopyQ - Synchronize Clipboard with Other Sessions
[Command]
Automatic=true
Command="
copyq:
// Select session to send data to.
var sessions = [
\"my_session_2\",
\"my_session_3\",
\"my_session_4\",
]