Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# Ping the Coralville router so the VPN tunnel stays up
ping -c 1 10.0.48.11
// Toggle Input Submit based on whether
// there are ANY input fields showing
function toggleInputSubmit() {
var dis, showit = false;
$$(".tag, .field a").each(function (el) {
el.observe("click", function (event) {
$$(".field").each(function (f) {
dis = f.getStyle("display");
if (dis !== "none") {
window.open(window.location.protocol+'//'+window.location.host+'/admin/');
size=`rsync --delete --delete-excluded -pthrv --exclude-from \
/Users/paul/.backup/exclude /Users/paul/Documents/ \
/Users/paul/Dropbox | egrep -o "total size is (.*)G" | egrep -o "[0-9\.]+"`
if [ "$size" = "" ]; then
size=0
fi
if [ `echo "$size < 1.8" | bc` = 0 ]; then
echo "`date`: WARNING: Size is running out for Dropbox backups.\
(Currently using ${size} GB.)" 1>&2
#! /bin/sh
# Author: Sean Garner <seanlgarner@gmail.com>
#
### BEGIN INIT INFO
# Provides: persevere
# Required-Start: $network $remote_fs
# Required-Stop: $network $remote_fs
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Start the live instance of Persevere
/**
* @fileOverview Script to upload files to Mosso Cloud Files for AKAR
* @author Nathan L Smith
* @date March 18, 2009
*/
/*global ActiveXObject, WScript, MF, AKAR */
(function () {
// 1: how could you rewrite the following to make it shorter?
foo ? bar.doSomething(el) : bar.doSomethingElse(el);
// 2: what is the faulty logic in the following code?
var foo = 'hello';
(function() {
@smith
smith / screening.js
Created September 29, 2010 15:09 — forked from rmurphey/screening.js
// 1: how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
#!/usr/bin/python
import os, re
from os.path import join, abspath, isfile, isdir, exists, basename
from shutil import copyfile, copytree, rmtree
from time import strftime, strptime, localtime
from time import localtime, strftime
import cloudfiles
"""
Author: Brandon Woodward, RHCE
#!/usr/bin/python
import os, re
from os.path import join, abspath, isfile, isdir, exists, basename
from shutil import copyfile, copytree, rmtree
from time import strftime, strptime, localtime
from time import localtime, strftime
import cloudfiles
"""
Author: Brandon Woodward, RHCE