Skip to content

Instantly share code, notes, and snippets.

@kentbye
kentbye / app-store-ratings.php
Created September 17, 2012 23:15 — forked from sgmurphy/podcast-ratings.php
Scrape iOS app review data from iTunes
<?php
/**
* Scrape the number of app reviews from iTunes.
*
* Set the iOS app id and the number of pages to scrape, and it creates a {$app_id}-reviews.csv file
*
* @author Kent Bye <[email protected]>
* Modified and extended from Sean Murphy's gist at https://gist.github.com/1878352
*/
@kentbye
kentbye / txt2mp3
Created October 6, 2012 00:33
Text-to-MP3 Bash script using Mac's say command
#!/bin/bash
FULLFILE=$1;
FILE="${FULLFILE%%.*}";
# Convert to an audio file at 310 words per minute. I personally select the UK's Serena as the Mac default voice
echo "converting $FILE.txt to $FILE.aiff";
`say -f $FILE.txt -r 310 -o $FILE.aiff --progress`;
echo "conververting $FILE.aiff to $FILE.mp3";
`ffmpeg -i $FILE.aiff $FILE.mp3`;
# Change the MP3 ID3 for the Album
id3tag -A$FILE $FILE.mp3;
@kentbye
kentbye / extract-content.rb
Last active December 29, 2015 03:39
This script removes the sidebar and navigation information from the HTML files of the Puppet Labs documentation in the "puppetdocs-latest" folder.It uses Nokogiri to select all of the content in div with a "primary-content" class, strips out the last "Back to top" text at the bottom, and then writes the data to a separate folder.
#!/usr/bin/env ruby
require 'nokogiri'
# This script will grab the main content out of the Puppet Labs documentation,
# and write the cleaned HTML files to a new directory.
#
# To use, first download http://docs.puppetlabs.com/puppetdocs-latest.tar.gz
# Create a TEMP folder at the top-level of a directory
# Unzip the puppetdocs-latest at the top-level, and then make a copy into the TEMP directory.
#
@kentbye
kentbye / extract-drupal-blog-content.rb
Last active January 3, 2016 09:19
This is a Nokogiri to strip out a specific class from a HTML page -- specifically the '.node-blog-post' class in this case, which is how Drupal labels a blog post. You'll need to scrape all of the HTML files into a folder, and then set up the directory structure as described in the notes.
#!/usr/bin/env ruby
require 'nokogiri'
# This script will grab the main content out of a Drupal blog post with class of '.node-blog-post',
# and then write the cleaned HTML files to a new directory. The header, sidebar, footer will
# all be removed.
#
# To use, first download set of blog post nodes from your site.
# For example, I created a view of the node ids (nid) from all of the blog posts.
# Then you can create a space-delimited shell command with the command of
@kentbye
kentbye / gist:9062306
Created February 18, 2014 00:43
Filter out the unix paths from a Jekyll-annotated HTML file
# Filter out the URL path from the Jekyll-annotated HTML file
cat puppet_3.html | grep "%}</li>" | cut -d, -f2 | sed 's/"\(.*\)".*/\1/' > puppet_3.txt
@kentbye
kentbye / html
Created August 6, 2014 00:29
Convert Markdown file to HTML and copy into copy buffer from the command line
#!/bin/bash
FULLFILE=$1;
FILE="${FULLFILE%%.*}";
# Convert markdown to html
echo "converting $FILE.md to $FILE.html";
`pandoc -i $FILE.md -o $FILE.html`;
echo "copying HTML into copy buffer";
`cat $FILE.html | pbcopy`;
@kentbye
kentbye / gist:d643216a3c2ace30cabc9efa023df3db
Created April 18, 2020 23:37
FFMPEG code for Spectral Frequency Display using showcqt (logarithmic frequency spectrum) + showspectrum (audio frequency spectrum) + showwaves
ffmpeg -i coltrane.wav -filter_complex "[0:a]showcqt=s=640x518:fps=30:axis=0,colorchannelmixer=.769:.393:.189:.349:0:.686:.168:0:.272:.534:.131,hue=n*2,pad=1280:720[vs]; [0:a]showspectrum=mode=separate:color=fiery:scale=log:orientation=vertical:overlap=1:slide=scroll:s=640x518[ss]; [0:a]showwaves=s=1280x202:mode=cline:scale=cbrt:colors=#FF8300[sw]; [vs][ss]overlay=w[bg]; [bg][sw]overlay=0:H-h[out]" -map "[out]" -map 0:a coltrane-output.mov
@kentbye
kentbye / readme.md
Last active October 11, 2023 18:40
Half-Life: Alyx VConsole Commands for VR Developers and Modders

Half-Life: Alyx VConsole Commands for VR Developers and Modders

Posted on April 20th, 2020. (Last updated April 21st, 2020)

This is a guide meant for VR developers and modders to use some of the VConsole commands and 2D tools for navigating Half-Life: Alyx for the purpose of modding and exploring the experiential design of this VR experience. The experience is best when experienced in VR, but there are some things that are actually easier and better to do in 2D if you're intention is to analyze how some of the maps and experiences were put together.

You need to add this to you Properties (Right Click on HL:A), and then "Set Launch Options" -console -vconsole -dev

@kentbye
kentbye / gist:d71b75031e904e5621b79d11c70b3d3f
Last active March 18, 2021 22:22
List of SXSW Sessions about XR, Storytelling, Ethics, & Experiential Design