Skip to content

Instantly share code, notes, and snippets.

View lantins's full-sized avatar

Luke Antins lantins

View GitHub Profile
<?php
// Find the code you see below... (starting at line 18)
$mail_headers = 'From: online-order@rivergretawriter.co.uk';
$mail_headers = 'Reply-To: noreply@rivergretawriter.co.uk';
// Change it to this:
$mail_headers = 'From: online-order@rivergretawriter.co.uk' . "\r\n";
$mail_headers .= 'Reply-To: noreply@rivergretawriter.co.uk' . "\r\n";
<?php
// filtering
$data = array();
$data['name'] = itsy_filter::text($this->_request->post('name'));
$data['age'] = itsy_filter::digit($this->_request->post('age'));
$data['address_line_1'] = itsy_filter::text($this->_request->post('address_line_1'));
$data->name = itsy_filter::text($this->_request->post('name'));
$data->age = itsy_filter::digit($this->_request->post('age'));
@lantins
lantins / secret_number_game.php
Created September 5, 2008 15:13
secret number game example
<?
// setup our session.
ini_set('session.use_only_cookies', true);
session_name('secret_number_game');
session_start();
// set the secret number; once!
function secret_number()
{
<?php
// more error details please.
error_reporting(E_ALL|E_STRICT);
ini_set('display_errors', true);
//setup session
ini_set('session.use_only_cookies', true);
session_name('easy_maths_game');
session_start();
<?php
class itsy_helper
{
public static function link_to($name = 'Link Name', $action = 'index', $controller = 'default')
{
if ($action == 'index') {
return sprintf('<a href="/?c=%s">%s</a>', $controller, $name);
}
else {
<?php
// set our attributes and values
$input_array = array(
'name' => 'luke',
'age' => 23,
'occupation' => 'developer'
);
$input_object = (object) $input_array;
function toggle_hidden_content(id)
{
if (document.getElementById(id)) {
if (document.getElementById(id+'_show').style.display != 'none') {
document.getElementById(id+'_show').style.display = 'none';
document.getElementById(id).style.display = 'block';
}
else {
document.getElementById(id+'_show').style.display = 'inline';
document.getElementById(id).style.display = 'none';
Last login: Mon Dec 22 09:41:09 2008 from macpro.lcegr.lividpenguin.com
Linux 2.6.27.7-smp.
'Twas the Night before Crisis
'Twas the night before crisis, and all through the house,
Not a program was working not even a browse.
The programmers were wrung out too mindless to care,
Knowing chances of cutover hadn't a prayer.
The users were nestled all snug in their beds,
#!/usr/bin/env ruby
require 'rubygems'
require 'net/https'
require 'hpricot'
# Luke Antins - http://lividpenguin.com/
# very quick scrap script to build dns zone files from 123-reg data.
# used for migrating from 123-reg's dns servers.
def scrape_for_dns_records(domain_name)
http = Net::HTTP.new('www.123-reg.co.uk', 443)
-- Database: `timelapse`
--
-- Table structure for table `people`
--
CREATE TABLE IF NOT EXISTS `people` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`)