Skip to content

Instantly share code, notes, and snippets.

View sjelfull's full-sized avatar

Fred Carlsen sjelfull

View GitHub Profile
require 'rubygems'
require 'open-uri'
require 'json'
USERNAME = "ryan"
API_KEY = "26k6otse2s586e4hcbzjy3quq830t3o4"
SITE = "flashden"
SLEEP_TIME = 60 * 5
api_url = "http://#{SITE}.net/api/edge/#{USERNAME}/#{API_KEY}/recent-sales+vitals.json"
FileETag None
<IfModule mod_rewrite.c>
RewriteEngine On
# Force www
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com$1 [R=301,L]
# Uncomment to Remove www, but comment the above 2 lines out.
# Otherwise the world will end
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* EE2 Deploy Helper Accessory
*
* @package ExpressionEngine
* @subpackage Control Panel
* @category Accessories
* @author Green Egg Media
* @link http://www.greeneggmedia.com
<?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/
*/
# Copyright 2009 Michael Ivey, released to public domain
# Disqus guts lifted from http://github.com/squeejee/disqus-sinatra-importer/tree/master
# I wanted it to run from MySQL and command line, instead of a Sinatra app
require 'rubygems'
require 'rest_client'
require 'json'
require 'sequel'
disqus_url = 'http://disqus.com/api'
<?php
/**
* Custom configuration bootsrtap file for ExpressionEngine
*
* Place config.php in your site root
* Add require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/config.php
* Add require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/database.php
* If you have moved your site root you'll need to update the require_once path
*
@sjelfull
sjelfull / gist:1050745
Created June 28, 2011 08:40 — forked from croxton/gist:1010797
ExpressionEngine Stash match/against example
{!-- get a list of people with last names starting A-F --}
{exp:channel:entries channel="people" sort="asc" orderby="person_lname"}
{exp:stash:append name="people_a_f" match="#^[A-F]#" against="{person_lname}"}
<li><a href="/people/{entry_url}" title="view profile">{title}</a></li>
{/exp:stash:append}
{/exp:channel:entries}
@sjelfull
sjelfull / gist:1493583
Created December 18, 2011 14:33 — forked from objectivehtml/gist:1478635
A better way to fetch EE parameters
private function param($param, $default = FALSE, $boolean = FALSE, $required = FALSE)
{
if($required && !$param) show_error('You must define a "'.$param.'" parameter in the '.__CLASS__.' tag.');
$param = $this->EE->TMPL->fetch_param($param);
if($param === FALSE && $default !== FALSE)
{
$param = $default;
}
@sjelfull
sjelfull / Sass-gradient.sass
Created December 21, 2011 01:30 — forked from chriseppstein/Sass-gradient.sass
Create gradients with ease using Sass
=gradient($startcolor, $endcolor, $startpos: top)
background-color: $startcolor / 2 + $endcolor / 2
@if $startpos == "top"
filter: unquote("progid:DXImageTransform.Microsoft.gradient(startColorstr='")#{$startcolor}unquote("', endColorstr='")#{$endcolor}unquote("')")
-ms-filter: unquote("progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$startcolor}', endColorstr='#{$endcolor}')")
background-image: -webkit-gradient(linear, top left, bottom left, from($startcolor), to($endcolor))
@if $startpos == "left"
filter: unquote("progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr='")#{$startcolor}unquote("', endColorstr='")#{$endcolor}unquote("')")
-ms-filter: unquote("progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr='#{$startcolor}', endColorstr='#{$endcolor}')")
background-image: -webkit-gradient(linear, top left, top right, from($startcolor), to($endcolor))
@sjelfull
sjelfull / injecting_scope.css
Created December 21, 2011 01:31 — forked from chriseppstein/injecting_scope.css
Cool things you may not know you could do with the & in sass
.tab {
.generatedcontent & {
&:before, &:after {
background-color: red;
}
.before, .after {
display: none;
}
}
}