This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' | |
Setup: | |
$ pip install gmusicapi==4.0.0 requests==2.5.1 | |
$ mkdir podcasts | |
$ python podcast.py | |
''' | |
import requests | |
import bs4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
# Find the latest Flash plugin debug for Linux and install it removing the standard plugin first. | |
# | |
# Usage: curl https://gist.githubusercontent.com/wernight/a3c1e30a3c64e350197f/raw/8c49f7c521a9ccb215edcdf9696642f37edbbb08/flash-debug.sh | sh | |
echo "Finding latest version from http://www.adobe.com/support/flashplayer/downloads.html" | |
flash_download=$(curl --silent http://www.adobe.com/support/flashplayer/downloads.html | grep -Po '(?<=")http[^"]*flashplayer_\d+_plugin_debug[^"]*\.tar\.gz(?=")' | head -n 1) | |
echo "Found and extracting $flash_download" | |
tmp_dir=/tmp/flashplayer_plugin_debug |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Requires gmusicapi from http://unofficial-google-music-api.readthedocs.org/en/latest/usage.html | |
""" | |
import os | |
from gmusicapi import Musicmanager | |
# From https://support.google.com/googleplay/answer/1100462 | |
AUDIO_FILE_EXTENSIONS = ('.mp3', '.m4a', '.wma', '.flac', '.ogg', '.m4a') | |
def upload_recursive(basedir): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Use inotify to watch a directory and execute a command on file change. | |
Watch for any file change below current directory (using inotify via pyinotify) | |
and execute the given command on file change. | |
Just using inotify-tools `while inotifywait -r -e close_write .; do something; done` | |
has many issues which are fixed by this tools: | |
* If your editor creates a backup before writing the file, it'll trigger multiple times. | |
* If your directory structure is deep, it'll have to reinitialize inotify after each change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# | |
# Gerrit `git submit` helper. Does a `git push HEAD:origin/refs/for/$current_branch_name` and supports drafts. | |
# | |
# Get latest version from https://gist.github.com/wernight/5916904 | |
# | |
# Install: | |
# 1. Save this script under one of you path (e.g., ~/bin/ or /usr/local/bin) | |
# 2. Make it executable (e.g., chmod +x ~/bin/git-submit) | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading.Tasks; | |
using NAnt.Core; | |
using NAnt.Core.Attributes; | |
using NAnt.Core.Tasks; | |
namespace MyTasks | |
{ | |
[TaskName("parallelexec")] | |
public class ParallelExecTask : TaskContainer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
# | |
# Save this file as ~/bin/git-submit | |
# | |
# Usage: git submit [--draft] [remote] | |
# Example: | |
# 'git submit' executed on a Git branch tracking origin/master will push to refs/for/master. | |
# | |
REMOTE=origin |