Skip to content

Instantly share code, notes, and snippets.

@kcmckell
kcmckell / RegistrationConfirmation.js
Last active December 22, 2015 12:28
Multi-purpose confirmation email sender. Connected to the spreadsheet that collects form responses, it is triggered on form submit. It parses the registration data, and then sends out several emails: 1. Confirmation to the registering player. 2. A copy of that registration to the webmaster (to serve as data backup). 3. A notification to the volu…
function onFormSubmit(e) {
// Log me like a hurricane.
var len = e.values.length;
for (var i = 0; i<len; i++){Logger.log(i + "<==>" + e.values[i]);};
// Gather form info into JavaScript variables.
var whoAreYou = e.values[28];
var Player;
var guestArray = new Array;
if (whoAreYou === 'Player') {
// Register a Player.
@kcmckell
kcmckell / .gitignore
Last active December 15, 2015 16:19 — forked from rbochet/.gitignore
Boilerplate gitignore file for LaTeX projects.
# Case-by-case basis for tracking PDF:
# *.pdf
# Latex files
*.aux
*.auxlock
*.glo
*.idx
*.log
@kcmckell
kcmckell / backup_utils.php
Last active December 15, 2015 14:19
A PHP file containing useful utilities for backing up files and databases on a Linux server.
<?php
class MailChunker {
public function __construct( $addr = "", $sub = "", $msg = "" , $from = "", $file = "", $maxfsize = "9MB") {
$this->addr = $addr; # Comma-separated string of email addresses.
$this->sub = $sub;
$this->msg = $msg;
$this->from = $from;
$this->fname = $file;
$this->maxfsize = $maxfsize;
};
@kcmckell
kcmckell / git-ra
Created January 30, 2013 07:59
Super useful shell one-liner to git-remove all deleted files. Credit goes to "Saeb" on <a href="http://stackoverflow.com/questions/1402776/how-do-i-commit-all-deleted-files-in-git">Stackoverflow</a>.
for x in `git status | grep deleted | awk '{print $3}'`; do git rm $x; done