Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Bianco iloveitaly

View GitHub Profile
@iloveitaly
iloveitaly / feed2.php
Created January 16, 2010 18:38
Kohana 2 feed class with better namespace support
View feed2.php
<?
class Feed2 extends feed {
/**
* Creates a feed from the given parameters.
*
* @param array feed information
* @param array items to add to the feed
* @param string define which format to use
* @param string define which encoding to use
* @return string
@iloveitaly
iloveitaly / phpinstall.bash
Created May 12, 2010 14:06
Compile PHP for OS X
View phpinstall.bash
#!/bin/bash
# Script to download & compile PHP for os x (restoration of a custom PHP installation after a system update)
# author: Michael Bianco <http://mabblog.com>
# References:
# http://jspr.tndy.me/2009/07/php-5-3-iconv-osx-symbols-missing-_libiconv/
# http://blog.yimingliu.com/2009/02/24/missing-library-symbols-while-compiling-php-528/
# http://bugs.php.net/bug.php?id=43189
@iloveitaly
iloveitaly / flash-screenshot.applescript
Created May 12, 2010 21:06
Take a screenshot of a SWF
View flash-screenshot.applescript
-- Author: Michael Bianco
-- References:
-- http://discussions.info.apple.com/thread.jspa?messageID=11447012
-- http://macscripter.net/viewtopic.php?id=28958
on run argv
generate_window_screenshot(item 1 of argv)
end run
View phpinstall.bash
#!/bin/sh
# Some Notes About Free TDS
# #
# # TDS
# #
# SYBASE=$HOME/usr/lib
# LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$SYBASE/lib
#
@iloveitaly
iloveitaly / vpn-utilities.applescript
Created July 3, 2010 19:05
Configure / create VPN connections via applescript
View vpn-utilities.applescript
-- Author: Michael Bianco <http://mabblog.com/>
-- Some help from: http://discussions.info.apple.com/message.jspa?messageID=10363317
on create_vpn_service(vpn_name)
tell application "System Preferences"
reveal pane "Network"
activate
tell application "System Events"
tell process "System Preferences"
View paypal.php
<?php
/* PHP Paypal IPN Integration Class Demonstration File
* 6.25.2008 - Eric Wang, http://code.google.com/p/paypal-ipn-class-php/
*
* This file demonstrates the usage of paypal.class.php, a class designed
* to aid in the interfacing between your website, paypal, and the instant
* payment notification (IPN) interface. This single file serves as 4
* virtual pages depending on the "action" varialble passed in the URL. It's
* the processing page which processes form data being submitted to paypal, it
@iloveitaly
iloveitaly / DateRange.php
Created July 6, 2010 14:16
Easily format ranges of dates
View DateRange.php
<?php
/**
* @author Michael Bianco <http://mabblog.com>
*
**/
class DateRange {
public $start;
public $end;
@iloveitaly
iloveitaly / clustermarker.js
Created July 8, 2010 14:56
Google Maps V3 Cluster Marker With Minimum Cluster Size
View clustermarker.js
// ==ClosureCompiler==
// @compilation_level ADVANCED_OPTIMIZATIONS
// @externs_url http://closure-compiler.googlecode.com/svn/trunk/contrib/externs/google_maps_api_v3.js
// ==/ClosureCompiler==
/**
* @author Michael Bianco <http://mabblog.com>
* @fileoverview Added minimum cluster size option
**/
@iloveitaly
iloveitaly / videobox.js
Created July 14, 2010 01:09
Videobox for MooTools 1.2.x
View videobox.js
var Videobox = {
init: function (options) {
// init default options
this.options = Object.extend({
resizeDuration: 400, // Duration of height and width resizing (ms)
initialWidth: 250, // Initial width of the box (px)
initialHeight: 250, // Initial height of the box (px)
defaultWidth: 425, // Default width of the box (px)
defaultHeight: 350, // Default height of the box (px)
View validator.js
function isValidEmail(email) { return /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(email); }
var InputValidator = new Class({
options: {
errorColor: 'red',
errorClass: 'error_text',
ignoreDisabled: false,
auxElementPadding: '1em'
},