Skip to content

Instantly share code, notes, and snippets.

View daleyjem's full-sized avatar

Jeremy Daley daleyjem

  • Cincinnati, Ohio
View GitHub Profile
@daleyjem
daleyjem / ratio.less
Last active August 29, 2015 14:04
Extends Bootstap: Makes any object adjust width/height to an aspect ratio
@screen-xs: 640px !default;
@screen-sm: 768px !default;
@screen-md: 1024px !default;
@screen-lg: 1280px !default;
.ratio {
position: relative;
&:before {
content: '';
@daleyjem
daleyjem / checkbox-custom.html
Created August 5, 2014 17:45
Custom Checkbox
<label>
<input class="checkbox-custom" type="checkbox" name="exclude" value="exclude">Don't remind me again
</label>
@daleyjem
daleyjem / cubic-bezier-easing.sublime-completions
Created December 3, 2014 20:43
CSS3 Cubic Bezier Easing Auto Completions for Sublime Text
{
"completions": [
{"trigger": "ease-in-quad", "contents": "cubic-bezier(0.550, 0.085, 0.680, 0.530)"},
{"trigger": "ease-in-cubic", "contents": "cubic-bezier(0.550, 0.055, 0.675, 0.190)"},
{"trigger": "ease-in-quart", "contents": "cubic-bezier(0.895, 0.030, 0.685, 0.220)"},
{"trigger": "ease-in-quint", "contents": "cubic-bezier(0.755, 0.050, 0.855, 0.060)"},
{"trigger": "ease-in-sine", "contents": "cubic-bezier(0.470, 0.000, 0.745, 0.715)"},
{"trigger": "ease-in-expo", "contents": "cubic-bezier(0.950, 0.050, 0.795, 0.035)"},
{"trigger": "ease-in-circ", "contents": "cubic-bezier(0.600, 0.040, 0.980, 0.335)"},
{"trigger": "ease-in-back", "contents": "cubic-bezier(0.600, -0.280, 0.735, 0.045)"},
@daleyjem
daleyjem / _slide-down-cover.scss
Created December 10, 2014 21:22
angular view transitions
.slide-down-cover {
@include z-index(base, 1);
&.ng-enter,
&.ng-leave {
transition: all 0.5s ease-out;
}
&.ng-enter {
transform: translate(0, -100%);
@daleyjem
daleyjem / _z-index.scss
Created December 10, 2014 21:28
SASS z-index() mixin
// Z-index
$z-indexes: (
base: 1,
modal: 1000
);
@mixin z-index($key, $increment: 0) {
z-index: map-get($z-indexes, $key) + $increment;
}
@daleyjem
daleyjem / css-lint-regex-search.md
Last active August 29, 2015 14:11
CSS Lint RegEx Search
ID or Class selectors with capital letter(s):
(\.|#)[^A-Z^\{^\s^/]*[A-Z]+[^\{^\s]*
Hard-coded hex values (3 or more characters):
#[A-Fa-f0-9]{3,}
Hard-coded @media query viewport numbers (i.e. 768px), instead of $variable
@media[^\{]+[0-9]+px[^\{]+\{
No space after colon in "attr:val;"
$(function(){
/** Constants **/
var ATTRIBUTE_PREFIX = 'track';
var ATTRIBUTE_EVENT_TYPE = "event-type"
var RESERVED_ATTRIBUTES = [
'events', // Reserved for Omniture
'eventType', // Reserved for client-side event type
'linkType', // Reserved for Omniture
'vars' // Reserved for Omniture
];
@daleyjem
daleyjem / eval.js
Created December 1, 2015 18:58
Handlebars Eval Helper
/**
* Evalutes a given expression by taking in a hash of variables as input values.
* ${variable} denotes a variable assigned in the hash.
*
* Example:
* {{eval "${a} + ${b}" a=1 b=2}}
* = 3
*/
module.exports.register = function(Handlebars, options) {
Handlebars.registerHelper('eval', function(expr, options) {
@daleyjem
daleyjem / git-commands.md
Last active March 17, 2020 02:13
Typical Git Commands

Git commands

Note: Always make sure you're in the project root when doing git commands, or else it won't see the .gitignore file and try to track files that should be ignored.

To reset your files back to the last commit:

git reset --hard HEAD

To create and checkout a new branch:

@daleyjem
daleyjem / ClickStream.js
Last active January 23, 2024 17:30
A Veeva ClickStream helper class for page and event tracking. *Requires veeva-library.js
/**
* Veeva ClickStream tracking class.
*
* Author: Jeremy Daley
* Liscence: MIT
*/
ClickStream.prototype.virtualInterval = -1;
ClickStream.prototype.calls = []; // Queued calls
ClickStream.prototype.debug = false;