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 | |
## | |
# RunRandom | |
# - A script to run n random applications. | |
# | |
# Copyright 2011 Luke Channings | |
# | |
# Usage: | |
# To run a single app: ./runrandom.sh |
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 | |
## | |
# Check for Film | |
# - A script to check for films in a directory, | |
# - and move them to another directory. | |
# | |
## | |
CHECKDIR="/Volumes/Media/Downloads" # Directory to check for videos. |
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 fetch_content(e) | |
{ | |
// Put the element into a variable. | |
target = e.srcElement; | |
if ( target.classList.contains("expanded") ){ | |
target.classList.remove("expanded"); | |
} | |
else { |
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 | |
# Mount the volume. | |
/sbin/mount_msdos.real "$@" | |
# MODIFY TO FIT YOUR NEEDS. | |
LABEL="HUBBLE" # USB Stick Label. | |
USBFOLDER="College Work" # Name of the folder on the USB Stick. (Can be a relative path.) | |
DESTINATION="/Volumes/Media/Dropbox/College Work" # Folder to which the USB Stick will be synchronised. |
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 load = function(url, callback) { | |
if ( ! window.registeredStylesheets ) window.registeredStylesheets = []; | |
if ( window.registeredStylesheets.indexOf(url) == -1) | |
{ | |
(document.head || document.getElementsByTagName("head")[0]).appendChild(function(){ | |
var link = document.createElement('link'); | |
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
// expands an item to show its inner box. | |
// @param e {Event} the event that triggered the expansion. | |
var expand = function(e) { | |
e.preventDefault() | |
if ( ! opened ) { | |
open() | |
} |
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
/** | |
* prints the prototype chain for a constructed object. | |
* @param {Object} a constructed object. | |
* @param asArray {Boolean} if true, the chain will be returned as an array. | |
*/ | |
function printPrototypeChain(instance, asArray) { | |
var chain = [] | |
while (instance = Object.getPrototypeOf(instance)) { |
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
/** | |
* computes the dimensions for an element to fully cover the viewport. | |
* @param vw {Number} the width of the viewport | |
* @param vh {Number} the height of the viewort | |
* @param a {Number} the aspect ratio of the element being displayed. | |
*/ | |
function getScaledDimensions(vw, vh, a) { | |
// variables to contain the width and height results. | |
var w, h, ox, oy; |
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 countListeners(tree) { | |
var count = 0 | |
for (var i in tree) { | |
if (tree.hasOwnProperty(i) && typeof tree[i] === "object") { | |
count += countListeners(tree[i]) | |
} | |
if (typeof tree._listeners === "function") { |
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
module.exports = { | |
/** | |
* reads ID3v1 tags from a buffer. | |
* @param buffer {Buffer} a file buffer containing the tag. (Does not have to be the entire file.) | |
* @returns {Object} with properties for {String}"title" {String}"artist" {String}"album" {Number}"year" {Number}"track" {String}"comment" {String}"genre". | |
*/ | |
getID3v1Tags: function(buffer) { | |
// who thought of this? it's stupid. |
OlderNewer