A Pen by Jack Shepherd on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <section class="product-card"> | |
| <div class="product-toggle"> | |
| <div><span class="icon-plus2"></span></div> | |
| </div> | |
| <div class="product-menu"> | |
| <div><span class="icon-menu"></span></div> | |
| </div> | |
| <div class="product-image"> | |
| <img src="http://localhost/ri-flats/images/products/1.jpg" alt="" /> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // General purpose 'animate' directive. | |
| // | |
| // Takes these arguments: | |
| // animate-once-target="{css selector}" animate-once-animation="{name of css animation}" animate-once-on="{event type}" | |
| // | |
| // Requires CSS set up as here: http://codepen.io/jackshepherd/pen/vkFad | |
| App.directive('animateOnce', function() { | |
| return { | |
| restrict: 'A', | |
| link: function(scope, element, attr) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // General purpose sticky directive | |
| app("sticky", ['$window', function ($window) { | |
| return { | |
| restrict: 'A', | |
| link: function(scope, element, attrs) { | |
| var $win = angular.element($window); | |
| if (scope._stickyElements === undefined) { | |
| scope._stickyElements = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo "This script will rebuild a Debian style package (deb) of latest stable" | |
| echo "Nginx. The original deb is from nginx.org apt repository." | |
| echo | |
| echo "This will prompt you yes or no on a few changes to the build as well as" | |
| echo "it will compile and package the latest Google NGX Pagespeed module." | |
| echo | |
| echo "This is built and tested on Ubuntu 12.04 LTS, fresh OS install." | |
| echo "There are no guarantees, and I take no liability if it breaks, but it" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="container"> | |
| <div id="cell1" class="cell"><p>blah</p></div> | |
| <div id="cell2" class="cell"><p>blah</p></div> | |
| <div id="cell3" class="cell"><p>blah</p></div> | |
| <div class="clear"></div> | |
| <div id="cell4" class="cell"><p>blah</p></div> | |
| <div id="cell5" class="cell"><p>blah</p></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="container"> | |
| <div id="cell1" class="cell"><p>blah</p></div> | |
| <div id="cell2" class="cell"><p>blah</p></div> | |
| <div id="cell3" class="cell"><p>blah</p></div> | |
| <div class="clear"></div> | |
| <div id="cell4" class="cell"><p>blah</p></div> | |
| <div id="cell5" class="cell"><p>blah</p></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //put thousand commas in | |
| $.fn.digits = function(){ | |
| return this.each(function(){ | |
| $(this).text( $(this).text().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") ); | |
| }) | |
| } | |
| //add a suffix to a digit, eg 2nd, etc | |
| $.fn.digitsuffix = function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function addslashes (str) { | |
| return (str + '').replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0'); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $('<style type="text/css"> .crazy-rainbow {background:-webkit-gradient(linear, right top, left bottom, color-stop(0.01,purple), color-stop(0.1,indigo), color-stop(0.2,blue), color-stop(0.4,green), color-stop(0.5,yellow), color-stop(0.7,orange), color-stop(0.8,red), color-stop(0.99,purple)); -webkit-background-size: 100% 100%;}</style>').appendTo("head"); |