Skip to content

Instantly share code, notes, and snippets.

@aenigme
aenigme / vimeo_ipad.html
Created August 23, 2010 18:39
Embed Vimeo videos with support for iphone and ipad
<script type="text/javascript">
var agent=navigator.userAgent.toLowerCase();
var is_iphone = (agent.indexOf('iphone')!='-1');
var is_ipad = (agent.indexOf('ipad')!='-1');
if (is_iphone) {
document.write("<video src='http://www.vimeo.com/play_redirect?clip_id=00000000&quality=mobile' controls='controls' width='000' height='000'></video>");
}
else if (is_ipad) {
document.write("<video src='http://www.vimeo.com/play_redirect?clip_id=00000000' controls='controls' width='000' height='000'></video>");
}
@aenigme
aenigme / .htaccess
Created August 9, 2010 18:51
Perishable Press 4G Blacklist
### PERISHABLE PRESS 4G BLACKLIST ###
# ESSENTIALS
RewriteEngine on
ServerSignature Off
Options All -Indexes
Options +FollowSymLinks
# FILTER REQUEST METHODS
<IfModule mod_rewrite.c>
@aenigme
aenigme / .htaccess
Created August 6, 2010 16:02
Kohana htaccess file
RewriteEngine on
RewriteBase /
# Add www rule
# RewriteCond %{HTTP_HOST} ^example.com$ [NC]
# RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
# Remove www rule
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
@aenigme
aenigme / mysql-regex-match.sql
Created July 28, 2010 20:10
MySQL REGEX match comma-delimitted list
SELECT * FROM table
WHERE id REGEXP '(,|^){$this->list}(,|$)'
@aenigme
aenigme / font-family.css
Created July 28, 2010 20:02
Font Family List
/* New/Updated List */
font-family: Arial,Helmet,Freesans,sans-serif;
font-family: 'Arial Narrow','Nimbus Sans L',sans-serif;
font-family: 'Bookman Old Style',Bookman,'URW Bookman L',serif;
font-family: 'Century Gothic',Futura,'URW Gothic L',sans-serif;
font-family: 'Comic Sans MS',cursive;
font-family: 'Courier New',Courier,Freemono,'Nimbus Mono L',monospace;
font-family: Constantina,Georgia,'Nimbus Roman No9 L',serif;
font-family: Consolas,'Lucida Console','Bitstream VeraSans Mono','DejaVu Sans Mono',monospace;
font-family: 'Lucida Sans Unicode','Lucida Grande','Lucida Sans','DejaVu Sans Condensed',sans-serif;
@aenigme
aenigme / config.php
Created July 28, 2010 20:01
Kohana System Configuration Hook
<?php defined('SYSPATH') or die('No direct script access.');
class System_Config
{
// First host should be the production server.
public static $configs = array(
'example.com' => array(
'database.default.connection' => array(
'type' => 'mysql',
'user' => 'username',