Skip to content

Instantly share code, notes, and snippets.

View delonnewman's full-sized avatar

Delon R. Newman delonnewman

View GitHub Profile
<?php
function pdsearch_menu() {
$items['profile_search'] = array(
'title' => 'Profile Search',
'page callback' => 'profile_search',
'access callback' => TRUE,
'type' => MENU_CALLBACK
);
return $items;
#!/usr/bin/perl -wT
#-*- Mode: perl; -*-
########################################################################
#
# Description:
# This is a front end for Original v0.3 written by Jimmac & Tigert.
# It can be used with mod_perl or just drop it in your cgi-bin
# directory.
#
# Type "perldoc image_viewer.pl" at your command line for more info.
require 'rubygems'
require 'sinatra'
require 'sinatra_warden'
require 'warden'
require 'rack/flash'
require 'haml'
User = Struct.new(:id, :name, :email)
#!/usr/bin/perl
use strict;
use warnings;
# Description: Converts given English text into Pig Latin
# Delon Newman <delon.newman@gmail.com> Copyright (C) 2007
$/="";
my $text = <>;
translate(\$text, create_dictionary($text));
@delonnewman
delonnewman / streamer.sh
Created August 28, 2011 00:48
stream webcam over network
#!/bin/bash
DEBUG=-vvv
# (0=pal, 1=ntsc, 2=secam, 3=pal nc, 4=pal m, 5= pal n, 6=ntsc jp)
NORM=1
WIDTH=320
HEIGHT=240
SCALE=1
FPS=23.976
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
Point(1, 2)
Point(3, 4)
import random
class Friend:
def __init__(self, name, age=False):
self.name = name
if not age or age == True:
self.age = random.randint(1, 100)
else:
self.age = age
def is_in(val, list):
for item in list:
if item == val:
return True
return False
print is_in(1, [1, 2, 3]) # True
print is_in(5, [1, 2, 3]) # False
if is_in('r', ['r', 'R', 'rand', 'random', 'Rand', 'Random']):
#
# = Pickr - A Gallery tool for Photographers
# These classes represent are an abstration away from the Flickr API.
# They provide methods for creating a gallery of photos for selecting
# and submitting to the photographer.
#
import yaml
import json
import flickrapi
<?php
require_once(dirname(__FILE__) . "/phpFlickr/phpFlickr.php");
require_once(dirname(__FILE__) . "/config.inc.php");
define("API_KEY", $config['flickr_api_key']);
define("USER_ID", $config['user_id']);
define("FLICKR_PHOTO_URL", "http://www.flickr.com/photos");
define("FLICKR_STATIC_URL", "http://farm5.static.flickr.com");
define("PRIMARY_PHOTO_CACHE", $config['primary_photo_cache']);