Skip to content

Instantly share code, notes, and snippets.

View allusis's full-sized avatar
👊

Tony Montemorano allusis

👊
View GitHub Profile
@allusis
allusis / input.number.js
Last active December 17, 2015 06:08
Apex - input number only
<script>
function isNumberOnly(evt) {
var charCode = (evt.which) ? evt.which : evt.keyCode;
//console.log(charCode);
if(charCode == 110 || charCode == 190) {
return true;
}
if (charCode != 46 && charCode > 31
&& (charCode < 48 || charCode > 57 && charCode < 96 || charCode > 105)) {
evt.preventDefault();
@allusis
allusis / IconSprite.component
Created February 15, 2016 18:50
SVG Icon Sprites in VisualForce
<!-- CSS will cascade the fill or stroke through the shapes, as long as there are no presentational fill attributes on the shapes themselves -->
<apex:component layout="none">
<svg xmlns="http://www.w3.org/2000/svg" class="hide">
<symbol id="chevron" viewBox="0 0 15.5 39.5">
<polygon points="15.5,19.8 10.2,19.8 0,0 5.2,0 "/>
<polygon points="15.5,19.8 10.2,19.8 0,39.5 5.2,39.5 "/>
</symbol>
</svg>
</apex:component>
@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
@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 / 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 / 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 / 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 / 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 / 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 / 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'),