Skip to content

Instantly share code, notes, and snippets.

View mikestecker's full-sized avatar

Mike Stecker mikestecker

  • Menifee, CA
  • 01:29 (UTC -08:00)
View GitHub Profile
{% macro truncate(text, limit, append) %}
{# settings #}
{% set suffix = append|default('...') %}
{% set punctuation = ['.',',','-',':',';'] %}
{# logic #}
{% set array = text|split(' ') %}
{% set arrayTruncated = array|slice(0, limit) %}
{% set string = arrayTruncated|join(' ') %}
{% if limit and array|length > limit %}
{% for mark in punctuation %}
@steverowling
steverowling / search_form_partial.html
Last active August 25, 2016 23:29
EE Search by distance from postcode using Low Search (search form)
<!-- Load Google Maps for geocoding of postcode -->
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<!-- Check we have a valid UK postcode before attempting geocode lookup -->
<script>
function checkPostCode(toCheck) {
// Permitted letters depend upon their position in the postcode.
var alpha1 = "[abcdefghijklmnoprstuwyz]"; // Character 1
var alpha2 = "[abcdefghklmnopqrstuvwxy]"; // Character 2
@KonradIT
KonradIT / hero4.md
Last active March 19, 2017 04:55
GoPro HERO4

#GoPro HERO4 (A tale of firmware leaks and marketing)

Written by /u/konrad-iturbe (Konrad Iturbe) and with help of /u/OverByThere's leaked firmware.


The GoPro HERO4 Black Adventure edition is 4x times more powerful than ever.

HERO4 cameras:

  • HERO4 Black (BANZAI)
@Jursdotme
Jursdotme / block-grid.scss
Last active January 21, 2021 17:03
Foundation 5 style Block-Grid for Bootstrap 3 (SASS Version)
// Block Grid
// Technique adapted from Foundation 5 for Bootstrap 3.
// https://github.com/zurb/foundation/blob/f755d8704123f86c281ede0b171881e2672f150d/scss/foundation/components/_block-grid.scss
// Original LESS Version by Christopher Mitchell (https://gist.github.com/ChrisTM)
// Converted to SCSS by Rasmus Jürs (https://github.com/Jursdotme)
[class*="block-grid-"] {
display: block;
margin: -($grid-gutter-width/2);
padding: 0;
@brandonkelly
brandonkelly / templating.md
Last active February 7, 2024 15:20
Templating in EE vs. Craft
@bomberstudios
bomberstudios / sketch-plugins.md
Last active February 26, 2024 07:02
A list of Sketch plugins hosted at GitHub, in no particular order.
@zspecza
zspecza / stylus-best-practices.md
Last active May 27, 2021 05:25
Stylus Best Practices

Stylus Best Practices

Introduction

This is a curated set of conventions and best practices for Stylus, an expressive, dynamic, robust and advanced CSS preprocessor. Frustrated with there not being a set of conventions set in place (that could be easily found), I set forth to find out on my own.

@kenzie
kenzie / craft.conf
Last active May 17, 2018 17:48
Nginx virtual host configuration for Craft CMS, PHP5-FPM, NGINX 1.2.1 and craft/config/general.php for friendly URLs.
server {
listen 80;
root /var/www/craft.dev/public;
index index.php index.html index.htm;
server_name craft.dev;
location / {
try_files $uri $uri/ @rewrites;
@tomdavies
tomdavies / deploy-production.rb
Created November 27, 2012 12:16
Deploying ExpressionEngine 2 with Capistrano
set :deploy_to, "/var/www/default"
set :branch, 'master'
#Remote DB info
set :dbuser, ""
set :dbname, ""
set :dbhost, ""
set :dbpass, ""
@pauloelias
pauloelias / README.md
Created August 23, 2012 16:57
Extended ExpressionEngine .htaccess/apache conf

ExpressionEngine .htaccess/Apache conf

Please use these at your own risk. I cannot be responsible for having no idea what I am doing and breaking your server.

This is a collection of Apache configuration settings that I use in my ExpressionEngine projects. Since I have always been a big fan of the HTML5 Boilerplate I took inspiration from their .htaccess file and tweaked my configuration with other settings I have used over the years.

This gist contains:

  • _EXTENDED.htaccess This is a general .htaccess file I rename and edit as needed for each site. Note: When I host a site on my prad/stage/dev servers I move most or all of these rules into the vhost.conf file
  • _SAMPLE.httpd.conf I use Ubuntu on my development, staging, and production servers so this is specific to Apache 2 on my setup. Essentially this file extends the apache2.conf (in my setup).