Skip to content

Instantly share code, notes, and snippets.

View battis's full-sized avatar

Seth Battis battis

View GitHub Profile
// https://www.facebook.com/david.salmanson.9/posts/10203810541089037
package net.battis.IndianRunMusicalChairs;
import java.util.*;
public class IndianRunMusicalChairs {
private ArrayList<Integer> players;
private boolean justSatDown = true;
@battis
battis / commit-www-to-github.sh
Last active August 29, 2015 14:05
A handy little shell script to schedule with crontab to regularly commit the latest version of a web server to Github.
#!/bin/bash
logfile=/var/www/git.log
exec >> $logfile 2>&1
date +"%Y-%m-%d %r"
cd /var/www
git fetch -q origin
git merge origin/master
git submodule update --recursive
git add -A .
git commit -q -m 'Auto Backup'
@battis
battis / single-menu.js
Last active August 29, 2015 14:09
Single Entry Resource Menu
// define your menu here
var resources = {
// menu title
// can also have a url property, so clicking the menu title sends you somewhere
// can also have a target property, so clicking the menu title opens in a specific frame/window/tab
title: 'Library',
url: 'http://library.stmarksschool.org',
columns: []
};
@battis
battis / .gitignore
Last active October 8, 2015 18:54
Minimal Eclipse Mars JDT .gitignore
######################################################################
# Minimal Eclipse Mars JDT
#
# https://gist.github.com/battis/f9adaebfab50c0d5bcb0
#
# Capture projects and user library configuration, but nothing else
# ignore Eclipse metadata
.metadata/*
!.metadata/.plugins
@battis
battis / input_hack.ipynb.json
Last active December 16, 2015 07:39
IPython Notebook Input Hack
{
"metadata": {
"name": "input_hack"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
{
"metadata": {
"name": "CS1 Examples"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
{
"metadata": {
"name": "Python Challenge (Sample Solutions)"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@battis
battis / resources-menu.js
Last active December 17, 2015 03:39
A bit of Javascript to add an additional hierarchical menu to the main Canvas navigation menu. Current updates to this project are taking place in this fork of our repo: https://github.com/smtech/canvas/tree/dev-resources-menu
// define your menu here
var resources = {
// menu title
// can also have a url property, so clicking the menu title sends you somewhere
// can also have a target property, so clicking the menu title opens in a specific frame/window/tab
title: 'Resources',
// an array of columns to display (don't go overboard here!)
columns: [
{
// columns can be divided into titled sections
{
"metadata": {
"name": "AP Chem Collaboration"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
{
"metadata": {
"name": "Balanced Equation"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{