Skip to content

Instantly share code, notes, and snippets.

Working from home

Erwin Heiser eheiser

Working from home
View GitHub Profile
chodorowicz / main.js
Created July 15, 2015 12:20
photoswipe disable zoom
View main.js
zoomEl: false,
maxSpreadZoom: 1,
getDoubleTapZoom: function(isMouseClick, item) {
return item.initialZoomLevel;
pinchToClose: false
bryandugan / Craft CMS SEO Meta.twig
Last active October 9, 2022 15:21
Craft CMS SEO Meta Tags
View Craft CMS SEO Meta.twig
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="{{ siteUrl }}favicon.png">
<title>{% if homeTitle is defined %}{{ siteName }} | {{ entry.homeTitle }}{% elseif entry.title is defined %}{{ entry.title }} | {{ siteName }}{% else %}{{ title }} | {{ siteName }}{% endif %}</title>
<link rel="stylesheet" href="{{ siteUrl }}assets/css/app.css" />
<script src="{{ siteUrl }}assets/bower_components/modernizr/modernizr.js"></script>
<!-- General Page Meta -->
{% if entry.seoDescription is defined %}
{% if entry.seoDescription is not empty %}
jmuspratt / Craft CMS: Sharing Links
Last active August 29, 2015 14:20
Twitter, Linkedin, Facebook, and Email
View Craft CMS: Sharing Links
sbone / foundation-5-bookmarklet-styles.css
Last active August 29, 2015 14:18
CSS for JS bookmarklet that shows which breakpoint Foundation 5 is reading
View foundation-5-bookmarklet-styles.css
#foundation-breakpoint-indicator:before {
content: 'NULL';
display: block;
position: fixed;
top: 0;
left: 50%;
margin-left: -50px;
width: 100px;
background-color: blue;
text-align: center;
kshnurov / jquery.photoswipe.js
Created February 23, 2015 23:37
PhotoSwipe: init from DOM using jQuery
View jquery.photoswipe.js
(function( $ ) {
$.fn.photoswipe = function(options){
var galleries = [],
_options = options;
var init = function($this){
galleries = [];
$this.each(function(i, gallery){
id: i,
bradfrost / gist:59096a855281c433adc1
Last active September 4, 2023 15:01
Why I'm Not A JavaScript Developer
View gist:59096a855281c433adc1

Answering the Front-end developer JavaScript interview questions to the best of my ability.

  • Explain event delegation

Sometimes you need to delegate events to things.

  • Explain how this works in JavaScript

This references the object or "thing" defined elsewhere. It's like "hey, thing I defined elsewhere, I'm talkin' to you."

  • Explain how prototypal inheritance works.
croxton /
Last active April 5, 2022 19:11
Using Resource Router for roll-your-own multi-language ExpressionEngine sites

Multi-language routing with Resource Router

The idea is to set up ISO 639-1 language code prefixes for urls (e.g. en/, de/, fr/), and set global variables {global:lang} and {global:lang_dir} for use in your templates.

In the control panel create a category group "languages" and populate it with your languages, setting the category url title to the appropriate 2-letter language code. Assign the category group to the channels you want to translate.

For example:

Category Name Category URL Title
nathansmith / bootstrap-grid-3.3.1.css
Last active October 4, 2021 08:43
Bootstrap's grid, in isolation. Normalize.css removed.
View bootstrap-grid-3.3.1.css
Bootstrap v3.3.1 (
This file has Normalize.css removed.
It still requires a "reset.css", so we're using this...
davist11 / ext.php
Last active December 16, 2015 22:09
EE Entry previewing
View ext.php
public function sessions_end($session)
if ($session->userdata['can_access_cp'] === 'y') {
$new_global_vars['gv_can_preview'] = TRUE;
} else {
$new_global_vars['gv_can_preview'] = FALSE;
low / low-search-ajax.js
Last active October 18, 2020 13:21
Using Low Search for ExpressionEngine with Ajax. Change any of the three variables on top to suit your needs. Tested with jQuery 1.9.0.
View low-search-ajax.js
var $form = $('#search'), // Search form
$target = $('#results'), // Results container
rp = 'search/ajax-results'; // Template for results only
// Function to execute on success
var success = function(data, status, xhr) {