Skip to content

Instantly share code, notes, and snippets.

View sjelfull's full-sized avatar

Fred Carlsen sjelfull

View GitHub Profile
@davist11
davist11 / Fancy File Inputs.js
Created October 25, 2010 21:32
Fancy File Inputs
var SITE = SITE || {};
SITE.fileInputs = function() {
var $this = $(this),
$val = $this.val(),
valArray = $val.split('\\'),
newVal = valArray[valArray.length-1],
$button = $this.siblings('.button'),
$fakeFile = $this.siblings('.file-holder');
if(newVal !== '') {
@redoPop
redoPop / jquery.loadshiv.js
Created December 10, 2010 05:35
Replacement jQuery.load() for use with innerShiv
// jQuery plugin based on .load() for use with innerShiv
// http://jdbartlett.github.com/innershiv for more info
// $('selector').loadShiv('example.html selector');
jQuery.fn.loadShiv = function (url, params, callback) {
var off, selector, self, type;
if (!this.length || typeof url !== 'string') {
return this;
}
<?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
*
@paranoiq
paranoiq / aaa.txt
Created February 15, 2011 18:24
Cross-browser styling of <fieldset> and <legend> without any additional HTML elements
formátování <fieldset> a <legend> je opravdu vojeb. veškerá řešení,
která jsem našel vyžadovala přidat do kódu nějaké pomocné <div>y nebo
<span>y. takové řešení mi ale nevyhovuje
nakonec jsem dospěl k tomuto. vypadá na pixel stejně ve všech novějších
prohlížečích včetně IE7. v IE6 a starších (bez selektorů + a >) nefunguje
falešný padding
@balupton
balupton / README.md
Last active April 20, 2022 13:21
Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo
@croxton
croxton / gist:1080050
Created July 13, 2011 10:22
Stash: persisting form values and caching
{!-- set context for this form to namespace our vars--}
{!-- @ refers to the current context --}
{exp:stash:context name="myform"}
{!-- register form variables from $_POST superglobal and save for 30 mins, scope to user's session --}
{exp:stash:get
name="filter"
dynamic="yes"
type="snippet"
save="yes"
@bpainter
bpainter / arrows.scss
Created July 15, 2011 19:08
Sass mixin for arrows based on The Shapes of CSS from Chris Coyier http://css-tricks.com/examples/ShapesOfCSS/
// --------------------------------------------------------
// arrows
// --------------------------------------------------------
// $direction: top, left, right, bottom, top-left, top-right, bottom-left, bottom-right
// $color: hex, rgb or rbga
// $size: px or em
// @example
// .element{
// @include arrow(top, #000, 50px);
// }
@rsanchez
rsanchez / gist:1189187
Created September 2, 2011 17:11
CartThrob add to cart outside of CT
<?php
$this->EE =& get_instance();
$this->EE->load->add_package_path(PATH_THIRD.'cartthrob/');
$this->EE->load->library('cartthrob_loader');
$params = array(
'product_id' => 37, //your entry_id
'item_options' => array(), //ie, 'product_size' => 'L',
@rsanchez
rsanchez / gist:1198583
Created September 6, 2011 18:46
cp_js_end referer
<?php
class My_ext {
/* blah blah blah */
public function cp_js_end()
{
//be courteous to other users of this hook
$str = $this->EE->extensions->last_call;
@rsanchez
rsanchez / gist:1226640
Created September 19, 2011 14:36
PHP current url ridiculousness
<?php
$url = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on')?'https':'http'.'://'.$_SERVER['HTTP_HOST'].($_SERVER['SERVER_PORT'] != 80)?':'.$_SERVER['SERVER_PORT']:''.$_SERVER['REQUEST_URI'];