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 ruby | |
| # | |
| # vidsampler – extract audio samples from online video | |
| # | |
| # for OSX only | |
| # | |
| # Usage: | |
| # | |
| # ruby vidsampler.rb [youtube url] [minute:second] [duration] | |
| # |
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 ruby | |
| # | |
| # Ruby methods for protecting against timing attacks | |
| # | |
| module ExpressionTimer | |
| # a shortcut to ExpressionTimer.send that passes in the object for which this module | |
| # was included | |
| # |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="http://d3js.org/d3.v2.min.js"></script> | |
| </head> | |
| <body> | |
| <div role="main"> | |
| <div class="charts"></div> | |
| <script language="JavaScript"> |
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 | |
| # | |
| # Remove spaces from the names of all files in the current directory | |
| # | |
| ls -1 | while read file; do new_file=$(echo $file | sed s/\ //g); mv "$file" "$new_file"; done |
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 | |
| # | |
| # Create a quicktime movie that combines a looping animated gif with an mp3. The resulting movie will | |
| # be the same length as the audio file. | |
| # | |
| if [ $(( $# - $OPTIND )) -lt 4 ]; then | |
| echo "Usage: $0 input.gif input.mp3 output.mov [framerate] [resolution]" | |
| exit 1 | |
| fi |
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
| require "java" | |
| require "benchmark" | |
| # To install and build CMU Sphinx, from the directory where you wish to run this script: | |
| # | |
| # svn co https://svn.code.sf.net/p/cmusphinx/code/trunk/sphinx4 | |
| # cd sphinx4 | |
| # ant | |
| # |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>JavaScript Web Speech API Example</title> | |
| <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> | |
| <script type="text/javascript"> | |
| var final_transcript = ''; |
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
| input_file, | |
| output_file, | |
| start_time, | |
| duration, | |
| fps, | |
| scale = *ARGV | |
| options = "-ao null -nosound -vo gif89a:fps=#{fps}:output=#{output_file} -ss #{start_time} -endpos #{duration} -vf scale=#{scale}" | |
| player_path = "/Applications/MPlayer OSX Extended.app/Contents/Resources/Binaries/mpextended.mpBinaries/Contents/mpextended.mpBinaries/Contents/MacOS/mplayer" |
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 | |
| # | |
| # Get the total duration for .mov video files in the current directory | |
| # | |
| find *.mov -print0 | xargs -0 /Applications/MPlayer\ OSX\ Extended.app/Contents/Resources/Binaries/mpextended.mpBinaries/Contents/mpextended.mpBinaries/Contents/MacOS/mplayer -vo dummy -ao dummy -identify 2>/dev/null | perl -nle '/ID_LENGTH=([0-9\.]+)/ && ($t +=$1) && printf "%02d:%02d:%02d\n",$t/3600,$t/60%60,$t%60' | tail -n 1 |
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
| --- osascript open_ableton_project.scpt [project name] | |
| on run argv | |
| tell application "Finder" | |
| --- get current directory | |
| set parentpath to POSIX path of (parent of (path to me) as text) | |
| end tell | |
| tell application "Ableton Live 9 Suite" | |
| open (POSIX path of parentpath) & "assets/ableton/" & item 1 of argv & " Project/" & item 1 of argv & ".als" | |
| end tell |