Skip to content

Instantly share code, notes, and snippets.

View 1stevengrant's full-sized avatar
🏠
Working from home

Steven Grant 1stevengrant

🏠
Working from home
View GitHub Profile
<?php
/* fill in your database name */
$database_name = "dbname";
/* connect to MySQL */
if (!$link = mysql_connect("dbservername", "dbuser", "dbuserpass")) {
die("Could not connect: " . mysql_error());
}
#!/bin/bash
# File: exp_permissions.sh
# Description: Sets permssions on a ExpressionEngine install
#
# Copyright 2009 George Ornbo (Shape Shed)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
<?php
/*
EE2 hidden configuration variables
Last updated: Jun 20 2010
Obtain this list by putting print_r($this->EE->config->config); on a PHP-enabled template.
See: http://eeinsider.com/tips/view/config-overrides-for-ee-1-and-2/
*/
@1stevengrant
1stevengrant / database.php
Created June 29, 2011 14:40
database.php for ExpressionEngine inside /system/expressionengine/config/
<?php
if ( ! defined('EXT')){
exit('Invalid file request');
}
require 'config.php';
?>
@1stevengrant
1stevengrant / visitphilly.com.js
Created July 20, 2011 16:01
visitphilly.com jquery plugin
/*
* Author: Marco Kuiper (http://www.marcofolio.net/)
* Sylvain Papet (http://www.com-ocean.com/)
*/
(function($) {
$.bgimgSlideshow = {version: '1.0.0'};
$.fn.bgimgSlideshow = function(options) {
options = jQuery.extend({
@1stevengrant
1stevengrant / gist:1151202
Created August 17, 2011 09:40
displays world times
<?php
// get the time for use in the clocks
$now = time();
date_default_timezone_set("Europe/London"); echo date("D H:i T", $now);
date_default_timezone_set("Asia/Kuala_Lumpur"); echo date("D H:i T", $now);
?>
@1stevengrant
1stevengrant / ee_upgrade.sh
Created August 27, 2011 22:02
EE upgrade shell
##########################################################################################
#!/bin/bash
# File: set_exp_permissions.sh
# Description: Performs an upgrade on a ExpressionEngine install for EE 2.x
##########################################################################################
# First we need to get the current working directory
DIR=$(pwd)
# If we can't find the file/folder required, this is the message we're displaying
@1stevengrant
1stevengrant / undo_gypsy.php
Created November 15, 2011 00:45
Undo Gypsy
<?php
$plugin_info = array(
'pi_name' => 'Undo Gypsy',
'pi_version' => '1.0',
'pi_author' => 'Brian Litzinger | BoldMinded.com & Nerdery.com',
'pi_description' => 'Undoes Gypsy',
'pi_usage' => 'BACK EVERYTHING UP FIRST!',
);
/*
This script is provided as is. There is no warranty or guarantee this will
@1stevengrant
1stevengrant / gist:1589101
Created January 10, 2012 13:31
MailChimp integration
<?php
/*///////////////////////////////////////////////////////////////////////
Part of the code from the book
Building Findable Websites: Web Standards, SEO, and Beyond
by Aarron Walter (aarron@buildingfindablewebsites.com)
http://buildingfindablewebsites.com
Distrbuted under Creative Commons license
http://creativecommons.org/licenses/by-sa/3.0/us/
///////////////////////////////////////////////////////////////////////*/
@1stevengrant
1stevengrant / gist:1589144
Created January 10, 2012 13:43
mailchimp signup form
<form id="signup" action="<?=$_SERVER['PHP_SELF']; ?>" method="get">
<p id="response">
<? require_once($_SERVER['DOCUMENT_ROOT'] . '/mc/store-address.php'); if($_GET['submit']){ echo storeAddress(); } ?>
</p>
<input type="text" class="text" placeholder="you@gmail.com" name="email" id="email" />
<input type="submit" class="button" value="Subscribe">
</form>