Skip to content

Instantly share code, notes, and snippets.

@litzinger
litzinger / ee-route-example.php
Last active August 29, 2015 13:56
How to extend EE's new routes feature in an extension hook.
<?php
public function core_template_route($uri_string)
{
ee()->your_lib_or_model->load_routes();
// Rest of your hook processing, if any.
}
public function load_routes()
@airways
airways / mod.extendedchannel.php
Created October 28, 2011 15:52
ExpressionEngine: Extending a core or third party module or plugin
<?php
class ExtendedChannel {
public __construct()
{
$this->EE = &get_instance();
}
public function extended_entries()
{
@low
low / gist:1391783
Created November 24, 2011 16:49
Simple EE conditionals turning advanced -- an example
// This will execute the exp:tag if first segment is empty
{if segment_1 != ''}
{exp:class:method}
{if var == "foo"}
Lorem
{if:else}
Ipsum
{/if}
{/exp:class:method}
@JamieMason
JamieMason / .babelrc
Created December 5, 2016 08:41
Tree-Shaking with Babel 6, Webpack 2, and React.
{
"presets": [
["es2015", {
"es2015": {
"loose": true,
"modules": false
}
}], "react"
]
}
@linssen
linssen / ee1x_cookies.md
Created May 22, 2012 08:47
ExpressionEngine cookies

ExpressionEngine 1.x cookies

This document outlines all of the cookies use by ExpressionEngine 1.x. With the EU cookie law coming into force on May 26th, it's important to know what cookies are set, which are 'essential' and why they are there. Hopefully this will help advise your decision process when altering your site to adhere.

I haven't yet gotten to any special addons etc. or even forums or comments. Please do fork and and send pull requests if you'd care to add anything.

Non essential

/*
This function will take the scripts specified and load them in order
asynchronously. It will not continue until the specified type from
each file is loaded.
*/
(function () {
function loadScripts () {
/*
This loadScript function takes the name of the object as it
@dmolsen
dmolsen / bubble-range.js
Created July 9, 2012 13:50
jQuery-less version of Chris Coyier's Value Bubbles for Range Inputs
/**********************************************************
* jQuery-less version of Chris Coyier's
* Value Bubbles for Range Inputs
* http://css-tricks.com/value-bubbles-for-range-inputs/
**********************************************************/
function modifyOffset() {
var el, newPoint, newPlace, offset, siblings, k;
width = this.offsetWidth;
newPoint = (this.value - this.getAttribute("min")) / (this.getAttribute("max") - this.getAttribute("min"));
/*Bootstrap modal size*/
@media (max-width: 1280px){
.modal-dialog {
height:630px;
width:800px;
}
.modal-body {
height: 500px;
}
}
import semver from 'semver';
import { engines } from './package';
const version = engines.node;
if (!semver.satisfies(process.version, version)) {
console.log(`Required node version ${version} not satisfied with current version ${process.version}.`);
process.exit(1);
}
@cimmanon
cimmanon / flexbox.scss
Last active September 17, 2020 15:05 — forked from anonymous/Flexbox mixins
This collection of Sass mixins to cover all 3 flexbox specifications that have been implemented. More information can be found here: https://gist.github.com/cimmanon/727c9d558b374d27c5b6
@import "compass/css3/shared";
// NOTE:
// All mixins for the 2009 spec have been written assuming they'll be fed property values that
// correspond to the standard spec. Some mixins can be fed values from the 2009 spec, but don't
// rely on it. The `legacy-order` mixin will increment the value fed to it because the 2009
// `box-ordinal-group` property begins indexing at 1, while the modern `order` property begins
// indexing at 0.
// if `true`, the 2009 properties will be emitted as part of the normal mixin call