Skip to content

Instantly share code, notes, and snippets.

@builtbylane
builtbylane / Angular Filter: Title Case
Created February 7, 2014 21:53
Angular Filter: Title Case
/**
* Description:
* simple title case => Simple Title Case
* Usage:
* {{some_text | titleCase}}
*/
app.filter('titleCase', function () {
return function (input) {
var words = input.split(' ');
@builtbylane
builtbylane / scss
Created February 15, 2016 01:45
_helpers.scss
/* Fool-proof @font-face */
/* Based on http://coding.smashingmagazine.com/2013/02/14/setting-weights-and-styles-at-font-face-declaration/ */
@mixin font-face($font-family, $file-path, $font-weight:'normal', $font-style:'normal') {
@font-face {
font-family: $font-family;
src: url('#{$file-path}.eot');
src: url('#{$file-path}.eot?#iefix') format('embedded-opentype'),
url('#{$file-path}.woff') format('woff'),
url('#{$file-path}.ttf') format('truetype'),
@builtbylane
builtbylane / google_conversion_iframe_hider.scss
Created February 15, 2016 01:53
Hide google_conversion_frame iframe
iframe[name='google_conversion_frame'] {
height: 0 !important;
width: 0 !important;
line-height: 0 !important;
font-size: 0 !important;
margin-top: -13px;
float: left;
}
@builtbylane
builtbylane / log all jQuery events
Last active September 20, 2017 17:15 — forked from kirkonrails/log all jQuery events
Log all jQuery events to console via redfine jquery trigger
const oldJQueryEventTrigger = jQuery.event.trigger;
jQuery.event.trigger = ( event, data, elem, onlyHandlers ) => {
console.log( event, data, elem, onlyHandlers );
oldJQueryEventTrigger( event, data, elem, onlyHandlers );
};
@builtbylane
builtbylane / angular-remove-white-space-filter.js
Created October 30, 2013 18:43
AngularJS – filter: removes white space from text. useful for html values that cannot have spaces
/**
* Description:
* removes white space from text. useful for html values that cannot have spaces
* Usage:
* {{some_text | nospace}}
*/
app.filter('nospace', function () {
return function (value) {
return (!value) ? '' : value.replace(/ /g, '');
@builtbylane
builtbylane / add-class-incrementally.js
Last active October 14, 2019 19:45
jQuery: add class to each item incrementally... good for fading in blocks
$(function() {
'use strict';
// deps... jquery
var $fade_this_in = $('.something-with-opacity-0');
function laneAddClassDelay(jquerobj, theclass, theinterval) {
setTimeout(function() {
jquerobj.addClass(theclass);
}, theinterval);
}