Skip to content

Instantly share code, notes, and snippets.

View lukemorton's full-sized avatar

Luke Morton lukemorton

View GitHub Profile
(function(d, isIE) {
var s = d.getElementsByTagName('script')[0];
function async(url) {
var scr = [];
for (u in url) {
var j = scr[scr.length] = d.createElement('script');
j.type = 'text/javascript'; j.async = true;
j.src = url[u];
s.parentNode.insertBefore(j, s);
}
<?php
// Most simple mail()
mail(
'Luke <supportlm@myfreeola.com>',
'Testing 1',
'This is the main message!!'
);
// mail() with additional headers
@lukemorton
lukemorton / jquery.defAccord.js
Created October 8, 2010 12:19
<dt>, <dd> show hide jQuery plugin..
/**
* Quick plugin for dt dd collapsible accordian
* @author Luke Morton
*
* @example
*
// For all <dt> elements in a document
$('dt').defAccord();
/**
* Localise window element and a semi-colon to fix any missing
* line endings in previous code.
*/
;(function (window, undefined) {
/**
* Local scope document and $
*/
var document = window.document;
<?php
/**
* My config
*
* To use this config simply do the following:
*
* $config = include('config.php');
*/
@lukemorton
lukemorton / .htaccess
Created November 9, 2010 15:57
Get ride of www, put this in your htdocs (or public_html) directory
# Some rewriting
RewriteEngine On
# Force remove www
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
#!/usr/bin/ruby
pid = fork do
def find_order
# check for order and return one if found
end
monitor = Fiber.new do
# Keep checking
loop do
<!doctype html>
<html>
<head>
<title>Testing post values of display:none;</title>
</head>
<body>
<pre><?php var_dump($_POST) ?></pre>
<form method="post">
<input type="hidden" name="hidden-display-block" value="1" />
<input type="hidden" name="hidden-display-none" value="2" style="display:none;" />
<?php
require_once('srv.php');
/**
* Set root URL
*/
Srv::config(array('root' => '/myfreeola-control-panel/e-mail/'));
/**
* GET /myfreeola-control-panel/e-mail/
<?php
/**
* Static singleton class for handling Assets
*
* @usage
* Asset::css('myscript.css');
*
* Asset::css(array(
* 'my-script.css',
* 'another.css',