Skip to content

Instantly share code, notes, and snippets.

<?php
$teams = array('team 1', 'team 2', 'team 3');
if((count($teams) % 2) == 1) {
array_push($teams, 'bye');
}
$fixed_team = array_slice($teams, 0, 1);
$rotating_teams = array_slice($teams, 1);
@troyswanson
troyswanson / httpd.conf
Created January 4, 2014 04:12
OS X Mavericks default Apache config
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
.col, .col-2, .col-1of2, .col-3, .col-1of3, .col-2of3, .col-4, .col-1of4, .col-2of4, .col-3of4, .col-5, .col-1of5, .col-2of5, .col-3of5, .col-4of5, .col-6, .col-1of6, .col-2of6, .col-3of6, .col-4of6, .col-5of6, .col-7, .col-1of7, .col-2of7, .col-3of7, .col-4of7, .col-5of7, .col-6of7, .col-8, .col-1of8, .col-2of8, .col-3of8, .col-4of8, .col-5of8, .col-6of8, .col-7of8 {
display: block;
position: relative;
margin-bottom: 0px;
float: left; }
.col-2, .col-1of2 {
margin-right: 4%; }
.col-1of2 {
@troyswanson
troyswanson / property.js
Created May 29, 2014 15:50
Property or $scope?
/*global angular*/
var app = angular.module('app', []);
app.controller('UsersCtrl', function ($http) {
var that = this;
$http.get('https://api.github.com/users/troyswanson/repos')
.success(function (data) {
that.repos = data;
});
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-32312837-1', 'auto');
ga('send', 'pageview');
</script>
@troyswanson
troyswanson / csgo_log.txt
Created September 9, 2015 15:25
CS:GO Log
L 09/08/2015 - 22:10:57: Log file started (file "logs\L192_168_001_140_27015_201509082210_000.log") (game "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo") (version "6102")
L 09/08/2015 - 22:10:57: Loading map "de_dust2"
L 09/08/2015 - 22:10:57: server cvars start
L 09/08/2015 - 22:10:57: "mp_c4timer" = "45"
L 09/08/2015 - 22:10:57: "mp_roundtime" = "10"
L 09/08/2015 - 22:10:57: "sv_gravity" = "800"
@troyswanson
troyswanson / keybase.md
Last active February 6, 2017 15:48
Keybase proof

Keybase proof

I hereby claim:

  • I am troyswanson on github.
  • I am troyswanson (https://keybase.io/troyswanson) on keybase.
  • I have a public key ASBiJJAvfq-cGJorZUAGMVW2eJRt9x4cIJrTmaK9Ui1k4Ao

To claim this, I am signing this object:

@troyswanson
troyswanson / t4-c1.rst
Last active July 21, 2016 20:16
United States Code

CHAPTER 1—THE FLAG

§ 1. Flag; stripes and stars on

The flag of the United States shall be thirteen horizontal stripes, alternate red and white; and the union of the flag shall be forty-eight stars, white in a blue field.

§ 2. Same; additional stars

@troyswanson
troyswanson / section-1.md
Created November 7, 2016 21:21
SoFi Loan Document

I. DEFERMENT, FORBEARANCE AND LOAN DISCHARGE

1.

In the event that I experience a financial or other hardship and am unable to make my regular monthly payments, or in the event I return to school after obtaining this Loan, but only for the purpose of obtaining a graduate degree and not for obtaining an additional undergraduate degree or license, you may offer certain deferment and forbearance options. Requests for forbearance must be submitted in accordance with your reasonable procedures and requirements, and the decision to grant my request for forbearance shall be solely at your discretion. I may obtain copies of deferment or forbearance request forms that explain the eligibility and documentation requirements for the type of deferment or forbearance I am requesting by sending an e-mail request to CustomerService@sofi.org or mailing your office a request at P.O. Box 29372, San Francisco, CA 94129-0372 or any future address or electronic method you provide to me. If I am in default on my Loan, I may n

@troyswanson
troyswanson / consul-server
Last active February 20, 2017 14:30
init.d scripts
#!/bin/sh
### BEGIN INIT INFO
# Provides: consul-server
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO