Skip to content

Instantly share code, notes, and snippets.

View chadothompson's full-sized avatar
🚜
Tinkering. Probably should be sleeping.

Chad Thompson chadothompson

🚜
Tinkering. Probably should be sleeping.
View GitHub Profile
@chadothompson
chadothompson / comicsans
Created November 28, 2012 21:11
Totally Awesome Text Styling
<div style="font-family:'Comic Sans MS'; font-size:20pt; text-align:center; padding-top:100px;">My Neat Website</div>
# Home page
GET / controllers.Application.index()
# Tasks
GET /tasks controllers.Application.tasks()
POST /tasks controllers.Application.newTask()
POST /tasks/:id/delete controllers.Application.deleteTask(id: Long)
# Map static resources from the /public folder to the /assets URL path
@chadothompson
chadothompson / index.scala.html
Created January 17, 2013 18:44
A tutorial view using Play/Scala
@(tasks: List[Task], taskForm: Form[Task])
@import helper._
@main("Todo List") {
<h1>@tasks.size() task(s)</h1>
@chadothompson
chadothompson / Application.java
Created January 17, 2013 18:46
A Play Tutorial Controller
package controllers;
import models.Task;
import play.*;
import play.data.Form;
import play.mvc.*;
import views.html.*;
public class Application extends Controller {
@chadothompson
chadothompson / multicase-documents.jsp
Created February 19, 2013 20:38
A Gist showing the use of "detatch" for JQuery UI drop events.
jQuery(".case").droppable({
hoverClass: "highlightNewcase",
drop: function (event, ui) {
// Don't submit if the ID is currently a child
var selectedDocumentId = jQuery(ui.draggable).attr('id').split('_')[1];
var selectedCaseId = jQuery(this).attr('id').split('_')[1];
var documentsParentCaseId = jQuery(ui.draggable.parent()).attr('id').split('_')[1];
if (selectedCaseId != documentsParentCaseId) {
ui.draggable.detach();
@chadothompson
chadothompson / wordpress-csv-export.php
Created July 24, 2013 14:33
Exporting WordPress post types, titles and URLs in a CSV format.
<?php
/*
export.php - a script for outputting post type, title and URL in CSV format.
All commas are also stripped from titles in order to keep the CSV format (for HootSuite import) versus keeping the titles as is.
*/
include "wp-load.php";
$posts = new WP_Query('post_type=any&posts_per_page=-1&post_status=publish');

Glad you're here!

PuppetConf 2013 Presentation (fryman)

but!

let's keep this our secret. If the talk hasn't started yet, please don't tell those around you about this page. sure, hint and all... but it's more fun if they find it themselves. Also, don't tweet about this until I ask you to (and yes, I'll ask you to. Pretty please? can you? oh, you're the best. I knew you would.).

I do promise I'll tell everyone eventually, but for now you can feel good you found this page before your friend Bob.

@chadothompson
chadothompson / Puppet Apache Redirect
Created August 31, 2013 20:56
A puppet snippet demonstrating how to create server redirects from a secondary domain to a 'real' domain. This is a local testing example that also defines the localhost (127.0.0.1) IPs to resolve to the hosts in question. (Real hostnames have been removed to protect the innocent.)
node default{
host{"myhost.com":
ip => "127.0.0.1",
}
host{"myhost2.com":
ip => "127.0.0.1",
}
@chadothompson
chadothompson / dsmjs-references.md
Last active December 22, 2015 18:19
A list of references for my Sept. 10, 2013 DesMoinesJS talk.

References - For Later Reading, or Right Now

  1. [Dice][] - where you are, who we are.
  2. [How GitHub Uses GitHub to Build GitHub][githubcubed]
  3. [Forking A Repository on GitHub][githubfork]
  4. [Submitting Pull Requests][githubpull]
  5. [Choosing A License][choosealicense]
  6. [OCTOCATS!!][octocats]
@chadothompson
chadothompson / Vagrantfile
Created November 6, 2013 17:10
Multi-machine vagrant example
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
$tomcat = <<SCRIPT
echo "172.16.237.150 puppet.itjb.vm puppet" >> /etc/hosts
rpm -ivh http://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-7.noarch.rpm
puppet agent -t