Skip to content

Instantly share code, notes, and snippets.

View tedkulp's full-sized avatar

Ted Kulp tedkulp

View GitHub Profile
We couldn’t find that file to show.
{validation_errors for='template'}
{render_partial template='editform.tpl'}
#!/usr/bin/env ruby
#Creates projects from approved estimates in Freshbooks
#(c)2010 Ted Kulp ted@tedkulp.com
#Requires the tedkulp-freshbooks.rb gem
#To install:
# sudo gem install tedkulp-freshbooks.rb
#
#Create a ~/.freshbooks file (yaml format) with 'url' and 'key' keys
#to set the URL and API keys for freshbooks
#!/usr/bin/env ruby
#Script to import a large set of users from a CSV
#into CMSMS's FrontEndUsers module. Assumes the
#'cms_' database prefix.
require 'rubygems'
require 'faster_csv'
require 'pp'
require 'mysql'
class TestDataMapperTable extends CmsDataMapper
{
var $counter = 0;
static public $static_counter = 0;
var $_fields = array(
'id' => array(
'type' => 'int',
'primary' => true,
'serial' => true,
#!/usr/bin/env ruby
require 'rubygems'
require 'nestful'
require 'pivotal-tracker'
require 'yaml'
# Ensure that you have the active_resource gem installed on your local system:
# gem install nestful pivotal-tracker
<?php
use \silk\database\Database;
class TestController extends \silk\action\Controller
{
function index()
{
$this->set('the_var', "It works!");
}
$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')
{
@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()
{
@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'