Skip to content

Instantly share code, notes, and snippets.

View tedkulp's full-sized avatar

Ted Kulp tedkulp

View GitHub Profile
@tedkulp
tedkulp / update.sh
Last active November 1, 2017 13:48
Update containers in docker-compose file
#!/bin/bash
# Updates containers in a docker-compose file. If passed a name, it will
# just update that container. If no argument is given, it will update
# all the containers in the file. It must be run in a directory where a
# docker-compose command will work and see it's yaml config file.
#
# WARNING: It does remove and create the container, so be careful if you
# care about state that's not saved outside of the container.
#
@tedkulp
tedkulp / base-view.js
Created January 22, 2014 16:50
How we add common functionality to different extended Marionette classes.
Module.WreqrMixin = function(obj) {
return _.extend(obj, {
setupWreqr: function() {
var _this = this;
this.reqres = new Backbone.Wreqr.RequestResponse();
this.commands = new Backbone.Wreqr.Commands();
this.request = function() {
return _this.reqres.request.apply(_this.reqres, arguments);
@tedkulp
tedkulp / main.cf
Created November 5, 2013 01:55
Postfix Config for forwarding email
# Default file for /etc/postfix/main.cf
# Append this to the bottom for the domains we're virtualizing
virtual_alias_domains = domain.com anotherdomain.com
virtual_alias_maps = hash:/etc/postfix/virtual
@tedkulp
tedkulp / iterm.vim
Last active December 27, 2015 07:49
Getting c-space and s-space working on console vim with iterm2.
:map ✠ <S-Space>
:map! ✠ <S-Space>
:vmap ✠ <S-Space>
:map ✡ <C-Space>
:map! ✡ <C-Space>
:vmap ✡ <C-Space>
// Configure installed adapters
// If you define an attribute in your model definition,
// it will override anything from this global config.
module.exports.adapters = {
// If you leave the adapter config unspecified
// in a model definition, 'default' will be used.
'default': 'mongo',
// In-memory adapter for DEVELOPMENT ONLY
@tedkulp
tedkulp / .tmux.conf
Created April 18, 2012 15:02
My .tmux.conf
set-option -g default-command "reattach-to-user-namespace -l zsh"
# Set prefix to something easy
unbind C-b
set -g prefix C-a
bind a send-prefix
# Lose the delay
set -sg escape-time 1
#!/bin/zsh
function initialize {
#git svn init http://svn.cmsmadesimple.org/svn/cmsmadesimple --stdlayout allcms
git svn init file:///Users/tedkulp/tmp/cms-svn --stdlayout allcms
git svn init http://svn.cmsmadesimple.org/svn/newsmodule --stdlayout News
git svn init http://svn.cmsmadesimple.org/svn/search --stdlayout Search
git svn init http://svn.cmsmadesimple.org/svn/filemanager --stdlayout FileManager
git svn init http://svn.cmsmadesimple.org/svn/menumanager --stdlayout MenuManager
git svn init http://svn.cmsmadesimple.org/svn/microtiny MicroTiny
@tedkulp
tedkulp / receive-email.rb
Created May 13, 2011 01:31
Email to Jekyll script
#!/usr/bin/env ruby
# -*- coding: utf-8 -*- #specify UTF-8 (unicode) characters
#Email to Jekyll script
#(c)2011 Ted Kulp <ted@tedkulp.com>
#MIT license -- Have fun
#Most definitely a work in progress
#Mail is an awesome gem. Install it.
require 'rubygems'
@tedkulp
tedkulp / TestController.php
Created May 1, 2011 02:37
Silly Ajax Demo w/ Silk
<?php
# app/controllers/TestController.php
use \silk\action\Controller;
use \silk\form\Form;
class TestController extends Controller
{
function index()
{
$form = new \silk\form\Form('blah');
$fs = $form->addFieldSet('blah', array('legend' => 'Config Options'));
$fs->addField('TextBox', 'thing');
$form->addButton('Submit');
$form->addButton('Cancel', array('value' => 'Get Me Out of Here!'));
if ($form->isPosted()) //Checks and then fills in values from POST
{
if ($form->getClickedButton() == 'Submit')
{