Skip to content

Instantly share code, notes, and snippets.

List available programs

$ ffmpeg -i <URL.m3u8>

Specifying program

$ ffmpeg -i URL.m3u8 -map <SOURCE_IDX>:p:<PROGRAM_NUMBER> -c copy output.ext
#!/bin/bash
<< ////
The script creates 'licenses' under '$ANDROID_HOME' and creates a file which proves
that the SDK license was accepted by the user.
Please copy this to your own account/gist/server. Every time there's an updated license, update the file with the new
license hash.
Legally if you run this script (or your own version of it), it means YOU accepted the license - don't trust someone else.
The hashes below are supposed to be taken from $ANDROID_HOME/licenses/android-sdk-license on YOUR machine, after you
@kdubau
kdubau / macOS-ISO-howto.md
Created September 24, 2018 17:57
How to create a bootable ISO of macOS install application.

Download

First download the install app bundle. Older versions can be hard to find but the current version of the time you read this, can be found in the App Store.

Create and attach a drive wtih hdiutil

To create a drive run this command: hdiutil create -o /tmp/Mojave.cdr -size 6200m -layout SPUD -fs HFS+J.
Next you will need to mount that drive hdiutil attach /tmp/Mojave.cdr.dmg -noverify -mountpoint /Volumes/install_build.

Create installation media in the new drive

Use the downloaded app bundle to create the media: sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build.

@santisbon
santisbon / Search my gists.md
Last active May 22, 2024 04:46
How to search gists.

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@shirish87
shirish87 / downloader.js
Created November 21, 2017 08:56
Apply response timeout when downloading large files from S3 using Axios.
const axios = require('axios')
const fs = require('fs-extra')
const TimeoutStream = require('./timeoutStream')
const DEFAULT_TIMEOUT = 10000
module.exports.download = function download(downloadURL, destPath, timeout=DEFAULT_TIMEOUT) {
const tmpPath = `${destPath}.tmp`
@beevelop
beevelop / gitprint.js
Created April 11, 2017 10:31
Print GitHub markdown files
document.querySelector('#readme').setAttribute('style', 'position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; background-color: white')
document.querySelector('body').appendChild(document.querySelector('#readme'))
window.print()
@palopezv
palopezv / dwm_config_pulseaudio.h
Last active April 4, 2024 10:29 — forked from neuro-sys/dwmconfig.h
dwm volume control with hardware multimedia keys (pipewire, pulseaudio, amixer and light as an extra)
/**
* dwmconfig.h
* Hardware multimedia keys
*/
/* Somewhere at the beginning of config.h include: */
/*
You obviously need the X11 development packages installed, X11proto in particular, but
here is the location of the keysyms header upstream copy if you can't bother
using the contents of your own hard drive. ;-P
@ethanhuang13
ethanhuang13 / xcode-beta-slink.sh
Last active February 3, 2023 20:21
Symbolic link from Xcode.app to Xcode-beta.app (Xcode 11.2)
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@yrevar
yrevar / imagenet1000_clsidx_to_labels.txt
Last active May 10, 2024 05:27
text: imagenet 1000 class idx to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',