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 "fileutils" | |
| def parse_contents(contents) | |
| valid_frames = [] | |
| contents.each do |frame| | |
| if valid_frame?(frame) | |
| valid_frames.push(frame) | |
| end | |
| end |
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 'fileutils' | |
| require 'digest/md5' | |
| def smart_cp(src, dest) | |
| cp = Proc.new {|src, dest| cp_r(src, dest) } | |
| smart_transfer(src, dest, cp) | |
| end | |
| def smart_mv(src, dest) | |
| mv = Proc.new {|src, dest| mv_r(src, dest) } |
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 | |
| WIDTH=1920 | |
| HEIGHT=1080 | |
| # DIR="." | |
| DIR="/media/OSXSUNNY/timelapse" | |
| INTERVAL_MINUTES=1 | |
| HOUR_TO_RECORD=7 | |
| NUM_FRAMES=60 |
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
| fileName=${customName:-$defaultName} |
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 | |
| echo "$(tput setaf 3)neko: $(tput setaf 5)$@$(tput sgr0)" |
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
| var dataSrc = "js/data.json"; | |
| var data = null; | |
| function loadJSON(callback) { | |
| var xobj = new XMLHttpRequest(); | |
| xobj.overrideMimeType("application/json"); | |
| xobj.open('GET', dataSrc, true); | |
| xobj.onreadystatechange = function () { | |
| if (xobj.readyState == 4 && xobj.status == "200") { | |
| callback(xobj.responseText); |
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
| # File Archiver | |
| # Takes all files and organizes based on date modified | |
| # Puts them all into monthly folders | |
| # Usage: | |
| # ruby file-archiver.rb SRC_PATH [DEST_PATH] | |
| # If DEST_PATH isn't entered, then SRC_PATH will be used as destination | |
| require 'fileutils' |
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
| def delete_empty_dir(root_dir) | |
| recursive_dirs = Dir["#{root_dir}/**/*"].select { |f| File.directory?(f) } | |
| # Sort into deepest dirs first | |
| recursive_dirs = recursive_dirs.sort { |a, b| b.split("/").length - a.split("/").length } | |
| puts recursive_dirs.each { |d| | |
| if (Dir.entries(d) - %w[ . .. ]).empty? | |
| Dir.rmdir(d) | |
| end | |
| } |
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
| ls *.jpg > stills.txt && mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:aspect=16/9:vbitrate=8000000 -flip -vf scale=1920:1080 -o timelapse.avi -mf type=jpeg:fps=30 mf://@stills.txt |
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
| function HighlightItem(delay, element) { | |
| var startTime = -1; | |
| var duration = 3000; | |
| var startC = [255, 255, 255, 0]; | |
| var highlightC = [255, 255, 100, 1]; | |
| element.style.backgroundColor = "rgba(" + highlightC.join() + ")"; | |
| function highlightLoop(){ | |
| var t = (Date.now() - startTime) / duration; |