Skip to content

Instantly share code, notes, and snippets.

View tommymarshall's full-sized avatar

Tommy Marshall tommymarshall

View GitHub Profile
@matthewpennell
matthewpennell / EE Master Comments Feed
Created January 27, 2009 21:15
Example ExpressionEngine RSS template for creating a feed of all your recent comments, reverse date ordered
{assign_variable:master_weblog_name="journal|linklog|sidebar"}
{exp:rss:feed weblog="{master_weblog_name}"}
<?xml version="1.0" encoding="{encoding}"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>{exp:xml_encode}My Comments Feed{/exp:xml_encode}</title>
<link>http://www.example.com/</link>
<description>Comments on my site</description>
<dc:language>{weblog_language}</dc:language>
<dc:creator>rss@example.com</dc:creator>
@aronwoost
aronwoost / README.md
Created July 25, 2011 19:46
How to install LAMP on a EC2 Amazon AMI

Launch the instance and connect with ssh.

##Update the server

sudo yum update

##Install php and MySQL packages

@ziadoz
ziadoz / awesome-php.md
Last active May 10, 2024 15:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@cviebrock
cviebrock / DateFormat.php
Created March 14, 2012 21:50
DateFormat class for Laravel (or anyone)
<?php
class DateFormat {
const DATE_SHORT = 'Y-m-d';
const DATE_LONG = 'F j, Y';
const DATETIME_SHORT = 'Y-m-d H:i';
const DATETIME_LONG = 'F j, Y, g:i a';
@lqez
lqez / gist:2404749
Created April 17, 2012 09:07
Modified swipe.js to get callback point on beginning swipe.
/*
* Swipe 1.0
*
* Brad Birdsall, Prime
* Copyright 2011, Licensed GPL & MIT
*
*/
window.Swipe = function(element, options) {
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@jgarber623
jgarber623 / _layout.php
Created May 1, 2012 15:21
Basic layout/view-style templating with PHP
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?php echo $page_title; ?></title>
</head>
<body>
<?php echo $content_for_layout; ?>
@nhunzaker
nhunzaker / gist:2830256
Created May 29, 2012 19:42
My FED Pre-Commit Hook
#!/usr/bin/env ruby
errors = false
# Create a simple line break
puts ""
# Now let's get a list of the changed files that have been staged
changed_files = `git diff --staged --name-only HEAD`.split("\n")
@averyvery
averyvery / Guardfile
Created July 3, 2012 21:06
Retina images with Guard
guard 'process', :name => 'shrink-images', :command => 'ruby resize-mobile-images.rb mobileretina' do
watch /^images\/mobileretina\/.+/
end
@brianblakely
brianblakely / rem-calibrate.css
Created July 13, 2012 18:55
Simulate vw with rems
/* Android stock browser won't let you set font-size smaller than 8px unless you apply this. */
:root {
-webkit-text-size-adjust: none;
-moz-text-size-adjust: none;
-ms-text-size-adjust: none;
-o-text-size-adjust: none;
text-size-adjust: none;
}