Skip to content

Instantly share code, notes, and snippets.

View iloveitaly's full-sized avatar

Michael Bianco iloveitaly

View GitHub Profile
@iloveitaly
iloveitaly / mselect.php
Created September 15, 2010 15:27
Formo 1.1.x multiple select driver
<?php defined('SYSPATH') or die('No direct script access.');
Formo::include_file('driver', 'select');
class Formo_mselect_Driver extends Formo_select_Driver {
public $selected_values = array();
public function __construct($name='',$info=array()) {
parent::__construct($name,$info);
@iloveitaly
iloveitaly / compile.bash
Created October 14, 2010 20:31
Combine & compress multiple css / js files
#!/bin/bash
# move to the directory which the script is placed in
# all file refences will be based off this location
cd `dirname $0`
# == Configuration Options ==
CSS_OUTPUT_FILE='css/core.css'
JS_OUTPUT_FILE='js/core.js'
@iloveitaly
iloveitaly / datepicker.js
Created October 20, 2010 17:54
Modification of the mootools datepicker to normalize input / output unix dates as UTC
/**
* datepicker.js - MooTools Datepicker class
* @version 1.16
*
* by MonkeyPhysics.com
*
* Source/Documentation available at:
* http://www.monkeyphysics.com/mootools/script/2/datepicker
*
* --
// $Id: plugin.js,v 1.5 2010/07/13 17:04:30 anrikun Exp $
/**
* @file
* Written by Henri MEDOT <henri.medot[AT]absyx[DOT]fr>
* http://www.absyx.fr
*
* Portions of code:
* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.html or http://ckeditor.com/license
@iloveitaly
iloveitaly / mailchimp-curl.php
Created December 14, 2010 12:47
MailChimp PHP API using CURL
<?php
class Mailchimp_Core {
var $version = "1.3";
var $errorMessage;
var $errorCode;
/**
* Cache the information on the API location on the server
*/
@iloveitaly
iloveitaly / epub-fix-cover.bash
Created January 14, 2011 16:16
Fixes the cover page for ePubs created by indesign
#!/bin/bash
# Author: Michael Bianco <http://mabblog.com/>
# Adds css width to the cover page, links the cover image on the cover page to a metadata tag
# Properly handles the mimetype on recompression
# This allows a ePub generated by InDesign to properly display the cover image on iBooks when the ePub is NOT distributed via the iBooks store
# xml compression info from: http://www.mobileread.com/forums/showthread.php?t=55681
@iloveitaly
iloveitaly / compress.bash
Created February 22, 2011 01:10
Compress css + js files
compress_web_files() {
JS_OUTPUT_FILE=$1
CSS_OUTPUT_FILE=$2
JAVASCRIPT_FILES=$3
CSS_FILES=$4
generate_js_include() {
echo "document.write('<script src=\"/includes/$1\" type=\"text/javascript\" charset=\"utf-8\"></script>');"
}
@iloveitaly
iloveitaly / AMURLLoader.h
Created May 7, 2011 16:24
Modification of AMURLLoader to include a -cancel method
//
// AMURLLoader.h
// FavIconTest
//
// Created by Andreas on 13.09.04.
// Copyright 2004 Andreas Mayer. All rights reserved.
//
// 2004-11-23 Andreas Mayer
// - added delegate
// - init/loaderWithURL will no longer call load automatically
@iloveitaly
iloveitaly / screenshot_active_window.applescript
Created June 29, 2011 17:17
Take a Screenshot of the Frontmost / Active Window
-- Author: Michael Bianco
-- http://mabblog.com/
-- References:
-- http://stackoverflow.com/questions/1866912/applescript-how-to-get-current-display-resolution/6524651#6524651
-- http://macscripter.net/viewtopic.php?id=28958
on run argv
screenshot_active_window(item 1 of argv)
end run
@iloveitaly
iloveitaly / instantsearch.js
Created July 6, 2011 17:56
Instant Filtering for MooTools
var InstantSearchManager = new Class({
Implements: [Options],
options: {
searchDelay: 400,
baseURL: '/download/search'
},
initialize: function(holder, search, options) {
this.setOptions(options);
this.element = $(holder);