Skip to content

Instantly share code, notes, and snippets.

View leoherzog's full-sized avatar

Leo leoherzog

View GitHub Profile
@leoherzog
leoherzog / streamvideos.sh
Created June 9, 2015 15:53
FFmpeg Directory Streamer v0.0.1
#!/bin/sh
ls | sort -R | tail -1 | while read file; do
ffmpeg -re -i $file -vcodec libx264 -preset veryfast -maxrate 3000k \
-bufsize 6000k -pix_fmt yuv420p -g 50 -ac 2 \
-ar 44100 -f flv rtmp://a.rtmp.youtube.com/live2/xd1936.sgqg-43s7-36h5-fttg
done
@leoherzog
leoherzog / youtubeloop.js
Last active March 28, 2016 19:25
A drop-in piece of Javascript that will take an array of YouTube video IDs and embed them on the page
<script>
// Replace line below with video id(s)
// e.g. ["K0FdCdQItDI"]; or ["K0FdCdQItDI","8B3dpnUcMBY"];
//
//
var ids = ["K0FdCdQItDI"];
//
//
// Don't edit below
if (ids.length == 1) {
@leoherzog
leoherzog / *Setup.md
Last active April 27, 2022 14:13
Setting Up Aerial Screensaver on Linux
  • sudo apt install xscreensaver jq aria2 notify-osd
  • Make a directory in $HOME called Aerial
  • Copy aerial-downloader.sh below into $HOME/Aerial
  • Run it once
  • crontab -e
  • 00 10 * * * sh $HOME/Aerial/aerial-downloader.sh to download new stuff (if any) at 10:00 every day
  • nano ~/.xscreensaver and add the code in the file below
  • Open up the XScreensaver app and pick "Apple Aerial"
  • gnome-session-properties and add xscreensaver -nosplash to the list
  • If you want, go into the System Settings and add a keyboard shortcut for Shift + Win + L to launch the command xscreensaver-command -lock
@leoherzog
leoherzog / concerto.log
Created February 16, 2016 20:08
Concerto 500 Error
I, [2016-02-16T15:00:34.605789 #7447] INFO -- : Started GET "/settings" for ###.###.###.### at 2016-02-16 15:00:34 -0500
I, [2016-02-16T15:00:34.607593 #7447] INFO -- : Processing by ConcertoConfigController#show as HTML
I, [2016-02-16T15:00:34.661042 #7447] INFO -- : Rendered concerto_config/show.html.erb within layouts/application (32.0ms)
I, [2016-02-16T15:00:34.661537 #7447] INFO -- : Completed 500 Internal Server Error in 54ms (ActiveRecord: 3.4ms)
I, [2016-02-16T15:00:35.188827 #7447] INFO -- : ** [Airbrake] Success: Net::HTTPOK
F, [2016-02-16T15:00:35.191368 #7447] FATAL -- :
ActionView::Template::Error (undefined method `select_values' for #<ConcertoConfig:0x000000073f16d0>):
50: <%= label_tooltip "concerto_config", c.key.to_sym, t("activerecord.attributes.concerto_config.#{c.key.to_sym}"), tip: c.description %>
51: <div class="input">
52: <% options = "" %>
@leoherzog
leoherzog / -r-nexus5x flair.css
Created February 19, 2016 14:59
Flair Code from /r/Nexus5x
/* --- User Flair ---*/
.flair:before {
content:"";
width:10px;
height:16px;
display:inline-block;
margin-top:-2px;
background-repeat:no-repeat;
background-image:url(%%flair-phones%%);
vertical-align:middle;
@leoherzog
leoherzog / *Set-up.md
Last active June 27, 2024 11:00
A Bash Script to Make RSS Feeds into Kindle Books

Grab a feed and make a Kindle book out of it's latest entry

This script downloads an RSS feed, assembles it's latest entry into a nice HTML file, downloads all of the assets required, generates a Kindle .mobi book with Amazon's official tool, sends me a Pushbullet notification that it worked, and uploads the .mobi book to my Dropbox.

If you wanted, you could then have a tool like this upload it to your Kindle wirelessly.

Set-up:

  • Copy parse.sh and dropbox_uploader.sh to your working directory that you'd like the script to live
  • chmod +x parsh.sh dropbox_uploader.sh
@leoherzog
leoherzog / *WeatherWallpaper.tsk.xml
Last active December 13, 2017 21:32
Weather Wallpaper Flickr Tasker Task
<TaskerData sr="" dvi="1" tv="4.8u1m">
<Task sr="task19">
<cdate>1458152913165</cdate>
<edate>1458658344165</edate>
<id>19</id>
<nme>Weather Wallpaper</nme>
<pri>100</pri>
<Kid sr="Kid">
<launchID>19</launchID>
<pkg>eqs.wdr.ynk</pkg>
@leoherzog
leoherzog / * set-up.md
Last active April 9, 2017 00:05
A quick-'n-dirty jQuery way of changing an HTML div contents based on if you are currently free or busy in Google Calendar
  • Make sure you are sharing at least free/busy details about your calendar to the public
  • Add freebusy.js and jQuery (with ajax support, not jQuery slim) to your project
  • Make an API Key at the Google Developers Console and enable Google Calendar support
  • Change the API key at line 5
  • Change the Google Calendar address from googlecalendarid@gmail.com to the one that you want to check on line 6
  • ???
  • Profit
@leoherzog
leoherzog / addDegreeSymbol.js
Created July 23, 2016 17:56
One-Liner Javascript Code to Add in Degree Symbols to Temperatures in a String
variable = variable.replace(/[0-9]{1,3}F/g, function addDegreeSymbol(x){return x.replace("F", "°F");});
variable = variable.replace(/[0-9]{1,3}C/g, function addDegreeSymbol(x){return x.replace("C", "°C");});
@leoherzog
leoherzog / Description
Created August 7, 2016 16:39
Muzei extension for Tasker that gets local weather photos from #ProjectWeather
Muzei Weather Wallpaper Updater v2 (39)
<Kill the task if Wi-Fi isn't connected and the "Wi-Fi Only" setting is on>
A1: Stop [ With Error:Off Task:Muzei Weather Wallpaper Updater v2 ] If [ %WIFII !~ *CONNECTION* & %WWWIFIONLY ~ true ]
<Kill the task if the battery is low and the "Don't run on low battery" setting is on>
A2: Stop [ With Error:Off Task:Muzei Weather Wallpaper Updater v2 ] If [ %BATT < 15 & %WWDONTRUNONLOWBATTERY ~ true ]
A3: Variable Set [ Name:%flickrapikey To:0952e1ceeeca7a0e1b3867533ba4beff Do Maths:Off Append:Off ]
<#ProjectWeather Flickr Group ID>
A4: Variable Set [ Name:%projectweathergroupid To:1463451@N25 Do Maths:Off Append:Off ]
A5: Get Location [ Source:Net Timeout (Seconds):15 Continue Task Immediately:Off Keep Tracking:Off ]
<Turn network LAT,LONG into two variables>