Skip to content

Instantly share code, notes, and snippets.

View allusis's full-sized avatar
👊

Tony Montemorano allusis

👊
View GitHub Profile
@allusis
allusis / esc.js
Created March 28, 2017 03:47
jQuery on ESC
// When ESC is pressed
$(document).on('keyup',function(evt) {
if (evt.keyCode == 27) {
// Do what you need to do.
};
});
@allusis
allusis / gist:bdccdd9a139414fa4365a58300f9fd54
Created February 22, 2017 02:12
Statamic Meta, OG, and Schema in Segments
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="{{ site_description }}">
{{ if segment_1 == "products" }}
<title>{{ title ensure_right=" / " }}{{ site_name }}</title>
{{ else }}
<title>{{ title }}</title>
{{ /if }}
<link rel="stylesheet" href="{{ theme:css }}">
@allusis
allusis / sample-gulpfile.js
Created February 12, 2017 02:35
Sample Gulp
var gulp = require('gulp'),
plumber = require('gulp-plumber'),
rename = require('gulp-rename');
autoprefixer = require('gulp-autoprefixer'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
pugInheritance = require('gulp-pug-inheritance'),
pug = require('gulp-pug'),
//imagemin = require('gulp-imagemin'),
cache = require('gulp-cache'),
@allusis
allusis / anchor-rebuilder.js
Created February 6, 2017 20:35
Anchor rebuilder when using <base>
// <base> is nice, but it ruins anchors..
// Let us rebuild him
$(document).ready(function() {
var pathname = window.location.href.split('#')[0];
$('a[href^="#"]').each(function() {
var $this = $(this),
link = $this.attr('href');
$this.attr('href', pathname + link);
});
});
@allusis
allusis / navigation.pug
Last active March 4, 2023 14:59
Pug nav template with active link checker
block PrimaryNavigation
- var NavItems = [{'url':'home','title':'Home', 'img':'nav','key':'home'},{'url':'about-us','title':'About Us', 'img':'nav','key':'about-us'}];
header
each page,i in NavItems
if PageID === page.url
a(class="active", href= + page.url + '.html')
svg
use(xlink:href= 'img/sprites/' + page.img + '.svg#' + page.key)
span.name= page.title
@allusis
allusis / apex-repeat-id
Created November 16, 2016 20:08
Dynamic ID's on apex:repeat
<apex:variable var="count" value="{!0}" />
<apex:repeat>
<div id="{!count}">...</div>
<apex:variable value="{!count+1}" var="count"/>
</apex:repeat>
@allusis
allusis / nav.jade
Created November 3, 2016 03:31
Jade Nav
block link
-var selected = '';
-var menu = { 'Dashboard': './dashboard.html', 'Inspections': './inspections.html', 'VIAs': './vias.html', 'Reports': './reports.html', 'Templates': './templates-manage.html' };
each val, key in menu
if selected === key
a.active(href=val, title=key, id=key)
span(class='icm icon-' + key)
span.name=key
@allusis
allusis / example.html
Created May 19, 2016 23:21
Custom Bootstrap Popover Content
<a data-toggle="popover" class="popper" data-placement="top">Link</a>
<div class="popover-content hide">
<!-- Content -->
</div
@allusis
allusis / popover.css
Last active April 21, 2016 04:32
Manipulate the Bootstrap popover with data properties
[data-style=help-popover] + .popover {
margin-left:-20px;
}
@allusis
allusis / .sfdc.gitignore
Created April 8, 2016 06:06
Mavensmate gitignore
## generic files to ignore
*~
*.lock
*.DS_Store
*.swp
*.out
## SASS files
*.sass-cache
*.css.map