Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
"""
Performs the basic setup instructions for a new Expression Engine install
as outlined here: http://expressionengine.com/docs/installation/installation.html
Accepts:
One parameter: if you'd like to rename the system folder (recommended, but optional)
Usage:
var images = [ "/path/to/image1.jpg",
"/path/to/image2.jpg",
"/path/to/image3.jpg",
"/path/to/image4.jpg"],
randNum = Math.floor( Math.random() * images.length );
$.backstretch( images[randNum] );
<!-- Typical script include -->
<script src="/_scripts/file1.js"></script>
<script src="/_scripts/file2.js"></script>
<script src="/_scripts/file2.js"></script>
<!-- Using Minify, it becomes this -->
<!-- http://code.google.com/p/minify/ -->
<script src="/_min/b=_scripts&f=file1.js,file2.js,file.js"></script>
# Add to your .htaccess file
FileETag none
ExpiresActive On
ExpiresDefault A0
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/ico A2592000
ExpiresByType text/css A2592000
<!-- Google-hosted jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
var position = 0,
images = [
'image1.jpg',
'image2.jpg',
'image3.jpg'
];
$.backstretch(images[position]);
setInterval(function() {
if(position++ > images.length) position = 0;
$("#backstretch img").attr("src", "/path/to/new/image.jpg");
$(window).trigger("resize");
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="/path/to/jquery.backstretch.min.js"></script>
<script type="text/javascript">
$.backstretch("http://static.tumblr.com/aa0lt19/0qql9lazk/img_8038.jpg");
</script>
@srobbin
srobbin / gist:1098045
Created July 21, 2011 19:52 — forked from ChicagoMap/Fusion Table
Practice Fusion Table
<!DOCTYPE html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100% }
</style>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
</head>
@srobbin
srobbin / gist:1711644
Created January 31, 2012 17:11
Responsive image test with NOSCRIPT
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Responsive image test with NOSCRIPT</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<style>
.container { width: 960px; margin: 0 auto; }
img { max-width: 100%; }