This file contains 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
# rails application template for generating customized rails apps | |
# | |
# == requires == | |
# | |
# * rails 2.3+, rspec, cucumber, culerity (langalex-culerity gem), machinist | |
# | |
# == a newly generated app using this template comes with == | |
# | |
# * working user registration/login via authlogic, cucumber features to verify that it works | |
# * rspec/cucumber/culerity for testing |
This file contains 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
/** | |
* Previewer test | |
*/ | |
background: #f06; | |
background: linear-gradient(left bottom, | |
hsla(340, 100%, 50%,.7), yellow); | |
min-width: 100px; | |
width: 2in; | |
transition-duration: 6s; |
This file contains 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 barleyBarHider(keyCode) { // need the keyCode? try whatthekeycode.com | |
var bb = jQuery('#barley-bar').children('#barley-logo').slideUp().end().hide(); | |
var pressCount = 0; | |
var keyCode = typeof keyCode==="number" && ~~keyCode>0 ? ~~keyCode : 27; // use ESC key if error or NaN | |
jQuery(document).keyup(function(e) { | |
if (e.keyCode == keyCode) { | |
pressCount++; | |
if (pressCount==3) bb.show().children('#barley-logo').slideDown(); | |
setTimeout(function(){pressCount=0},1000); | |
} |
This file contains 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
// Modernizr additional tests for device, user agent, etc. | |
Modernizr.addTest('ie',function(){return!!navigator.userAgent.match(/MSIE/i)}); | |
Modernizr.addTest('ios',function(){return/iP(ad|hone|od)/i.test(navigator.userAgent)}); | |
Modernizr.addTest('mobile',function(){return!!navigator.userAgent.match(/android.+mobile|avantgo|bada\/|MeeGo|NokiaN9|blackberry|BlackBerry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|Kindle|Kindle Fire|silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|pad|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fl |
This file contains 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
$scope.timeList = [ | |
"12:00 AM", | |
"12:15 AM", | |
"12:30 AM", | |
"12:45 AM", | |
"1:00 AM", | |
"1:15 AM", | |
"1:30 AM", | |
"1:45 AM", | |
"2:00 AM", |
This file contains 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
// find first matching prev sibling of this or of parents, within 3 levels up | |
$form.prevOrAunt('.form-title,.panel-title,.panel-heading,:header', 3); | |
(function($) { | |
$.fn.prevOrAunt = function(search, optionalLimit) { | |
// prevOrAunt(search,optionalLimit) - searches only prev and aunts [Note: aunt=parent.prev, uncle=parent.next] | |
// search for matches in priority: prev siblings, parent prev siblings (repeat) | |
// with optional number limit for how far up the tree to search (or false to disable limit) | |
// * Modified from @Loren - http://stackoverflow.com/a/26237214/264601 |
This file contains 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
// find first matching prev sibling, parent, or parent prev sibling, within 3 levels up | |
$form.prevParentPrev('.form-title,.panel-title,.panel-heading,:header') | |
(function($) { | |
$.fn.prevParentPrev = function(search, optionalLimit) { | |
// prevParentPrev(search,optionalLimit) - similar to prevOrAunt() but also searches parents | |
// search for matches in priority: prev siblings, parent, parent prev siblings (repeat) | |
// with optional number limit for how far up the tree to search (or false to disable limit) | |
// * Modified from @Loren - http://stackoverflow.com/a/26237214/264601 |
This file contains 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($) { | |
$.fn.thisOrNothin = $.fn.thisOrNothing = function(search) { | |
// thisOrNothing(search) - gives back what you gave it, unless it's empty | |
// use the optional search to filter by selectors | |
// EX: $('div').thisOrNothing('.hidden') | |
// *Note: Don't you go chainin' this now... if it's NULL it'll blow | |
// First attempt to filter | |
var filtered = search ? this.filter(search) : this; |
This file contains 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 | |
# set qry to the query (argument one) | |
qry="$1" | |
# fix SNIP_DB location in case it contains tilde (won't expand in quotes) | |
SNIP_DB=$( echo $SNIP_DB | sed "s:^~:$HOME:" ) | |
# set the internal delimeter (idlm) to some char(s) that will never be used | |
idlm='' |
This file contains 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
// when you're trying to use `position:sticky` on an element | |
// you'll have trouble if any parent/ancestor element has | |
// overflow set to anything other than "visible" (such as: auto,hidden,overlay,scroll) | |
// & turns out if a parent is `display:flex` it might need some love | |
// (to remedy this you can set the `align-self` of your sticky element) | |
// see here for how the display & align-self properties affect: http://bit.ly/2ZaRu4o | |
// so, to find those troublesome parents... | |
// copy & paste this into Chrome Inspector/Dev Tools console | |
// (and be sure to change the #stickyElement below, if needed) |
OlderNewer