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
/* private modernizr mixin | |
* | |
* downside - only works on single-element selectors. nesting still works though. | |
* | |
* @param features - a list of modernizr test classes e.g.: csstransitions opacity OR csstransitions, opacity | |
* @param declaration - the {block} of content passed by the block mixins +yep()/+nope() | |
* @param support - boolean, true if testing support, false if testing no support | |
* | |
* 1. if testing for support, set selector to empty string | |
* if testing for no support, set selector to ".no-js" appended by |
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
# Usage | |
$("textarea").counter | |
elements: | |
counter: '.note-area p.counter' | |
# Manages Character Counts | |
jQuery.fn.counter = (opts) -> | |
defaults = | |
elements: | |
counter: '.counter' |
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
#http://thehackerolympics.com/ | |
key = 'qwertyuiop' | |
string = 'iirytroyppytpeppowuiyoiuypipiyuyotyoiwiytorouqyiepyirueuiprpptwyiroqwtuyipourrrourorwipowiorutpwtwruuioquteorioriyutwqyyprptuqqquuituyywyuoewtrppqwrtiiruirpwyptpuoyyoeyerpqiotuieripurouwuwyuwrworowitoepoypeipeypiireeorrwripuuteoitpuutturruwiyryeetyrioweytueqrrrtotrpiqetoyepoipiwrwpppiritupwipruooiepoweypiuwrqywuuwyiroqpqpruioopuiuerputpwwuuiqwpiroewrtwiqerteoyeqtutwoeoipioiuqiiiouuoqtuuwtuwiiqwppqitywuqpuutrqiyoeuuutwrwtoqrqyoeyoiporuuioiwryoeruypreprqroiyuqwtuyoytoerwqryeeripryieypiwqirtriurueypiuyuypriuiwptywppupoioyrewooytreteeriiwroietuwypieeeeeqpiiiwrirtppoeyiwpooyyporpruwuoriiyowuytiwpwpryeywotoyirqypyypoeptiuwwoyprquoetepptorwiewprpiywwtuieeiweytrrwiqtwotioryoiptyyyuriiqiyroeeiqepwteuwptpruuypipieuoiiuuweeuryuuowporrooyywyyrryriqyirooitirueruptotpryoqtipippyptiurwyiryooywtryyuurtrutwqiqiiiqwouyeooueoturuowiuwrtruwwiupwopwweoo' | |
#split into unique pairs | |
array = string.scan(/../) | |
unique_pairs = array.keep_if {|letters| array.count(letters) == 1} |
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(window, undefined){ | |
window.getComputedStylePropertyValue = function(el,cssProperty){ | |
if(!window.getComputedStyle){ | |
if(document.defaultView && document.defaultView.getComputedStyle){ | |
return document.defaultView.getComputedStyle.getPropertyValue(cssProperty); | |
} | |
else{ | |
var camelCasedCssProperty = getCamelCasedCssProperty(cssProperty); | |
if(el.currentStyle){ | |
return el.currentStyle(camelCasedCssProperty); |
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
loadHtml = (elem, url) -> | |
$.ajax | |
url: url | |
context: document.body | |
dataType: "html" | |
success: (data) -> | |
elem.html data |
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
require File.expand_path('../boot', __FILE__) | |
require 'rails/all' | |
if defined?(Bundler) | |
# If you precompile assets before deploying to production, use this line | |
Bundler.require(*Rails.groups(:assets => %w(development test))) | |
# If you want your assets lazily compiled in production, use this line | |
# Bundler.require(:default, :assets, Rails.env) | |
end |
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
// CONDITIONALS | |
if (foo && bar) { | |
} | |
if () { | |
} else { | |
} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> | |
<CORSRule> | |
<AllowedOrigin>*</AllowedOrigin> | |
<AllowedMethod>GET</AllowedMethod> | |
<AllowedMethod>POST</AllowedMethod> | |
<AllowedMethod>PUT</AllowedMethod> | |
<MaxAgeSeconds>3000</MaxAgeSeconds> | |
<AllowedHeader>*</AllowedHeader> | |
</CORSRule> |
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
class Point | |
constructor: (@x = 0, @y = 0) -> | |
if isNaN(@x) or isNaN(@y) | |
throw new Error('Invalid coords') | |
add: (point) -> | |
@x += point.x | |
@y += point.y | |
subtract: (point) -> |
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
git_packages: | |
pkg.installed: | |
- names: | |
- libssl-dev | |
- git | |
- pkg-config | |
- build-essential | |
- curl | |
- gcc | |
- g++ |
OlderNewer