Skip to content

Instantly share code, notes, and snippets.

View eyecatchup's full-sized avatar

Stephan Schmitz eyecatchup

View GitHub Profile
@eyecatchup
eyecatchup / playlist2mp3.sh
Created June 30, 2017 06:02
playlist2mp3.sh - Small, useful shell wrapper for `youtube-dl`
#!/usr/bin/env sh
YTDL_UNIVERSAL_PATH="Python27/Scripts/youtube-dl"
help() {
echo ""
echo "playlist2mp3 - A small, useful youtube-dl wrapper."
echo ""
echo "Download a YouTube playlist and for each video,"
echo "extract its audio stream & save it to an mp3 file."
/* Helper function, required if jQuery is not available */
var ajax = function ajax(method, url, callback) {
var xhr = !!window.XMLHttpRequest ? new XMLHttpRequest : new ActiveXObject("Microsoft.XMLHTTP");
xhr.onreadystatechange = function() {4 == this.readyState && callback(xhr)};
xhr.open(method, url, true);
xhr.send();
};
function do_something(coords) {
// Do something with the coords here

In case you oupsed again..

The "Oh no I should have been working in a branch" Trick

# takes staged changes and 'stashes' them for later, and reverts to HEAD. 
$ git stash
 
# creates new branch and switches to it, then takes the stashed changes and stages them in the new branch.   fancy!
$ git stash branch new-branch-name
@eyecatchup
eyecatchup / git-tricks.md
Created June 26, 2017 22:27
Git Tricks

Git Tips & Tricks

Oups Tricks

The "I forgot something in my last commit" Trick

# first: stage the changes you want incorporated in the previous commit
 
# use -C to reuse the previous commit message in the HEAD
<ul class="items">
<li><a href="#" data-str="rot" data-hl="de">rot</a></li>
<li><a href="#" data-str="gelb" data-hl="de">gelb</a></li>
<li><a href="#" data-str="and now in english" data-hl="en">and now in english</a></li>
</ul>
<script>
var Say = {
$audio: !1,
createAudioElem: function(e) {
/**
* Get a tokenized(!) request URL for a Google Translate tts audio file; i.e.:
* https://translate.google.com/translate_tts?q=hello%20world&tl=en&tk=159027.275675
* (URL shortened for better readability.)
*
* @author Stephan Schmitz <eyecatchup@gmail.com>
* @copyright: Google Inc.
* @param urldecodedString {string} The string to be spoken in the audio file.
* @param hl {string} Optional two-letter country code for the output language. Default: English.
* @return {string} The fully-qualified request URL to the audio file (Content-type: audio/mpeg).
tt_content.image.20.stdWrap.parseFunc.nonTypoTagStdWrap.HTMLparser.tags.img.fixAttrib {
width.unset = 1
height.unset = 1
border.unset = 1
}
tt_content.textpic.20.stdWrap.parseFunc.nonTypoTagStdWrap.HTMLparser.tags.img.fixAttrib {
width.unset = 1
height.unset = 1
border.unset = 1

[jQuery.mmenu][mmenu] demos

  • Basics
    • [most basic demo][default-demo]
    • [off-canvas][off-canvas]
    • [on-canvas][on-canvas]
  • Styles
    • [style-1][style-1]
  • [style-2][style-2]
var requirejs, require, define;
(function(e) {
function h(e, t) {
return f.call(e, t)
}
function p(e, t) {
var n, r, i, s, o, a, f, l, h, p, d, v = t && t.split("/"), m = u.map, g = m && m["*"] || {};
if (e && e.charAt(0) === ".")
if (t) {
v = v.slice(0, v.length - 1),
@eyecatchup
eyecatchup / ffmpeg.md
Last active May 2, 2024 10:06
Some common ffmpeg commands, I tend to forget..

cut sequence from mp4 video

ffmpeg -ss <start_time_hh:ii:ss> -i input.mp4 -to <length_in_hh:ii:ss_from_start> -c copy ./out.mp4
ffmpeg -ss 00:47:42 -i input.mp4 -to 00:01:49 -c copy ./out.mp4

create thumbnail images from input video (@30fps)