This runs provides an .optim job for dragonfly and also adds the .optim job into .thumb
This requires you have the 'image_optim' gem and it's dependencies.
module DefaultValues | |
def has_default_values(default_values = {}) | |
cattr_accessor :default_values | |
self.default_values = default_values | |
after_initialize :assign_default_values | |
include InstanceMethods |
// Adapted from the awesome zurb foundation | |
// https://github.com/zurb/foundation/blob/v5.2.0/scss/foundation/components/_block-grid.scss | |
// | |
// Block Grid Mixins | |
// | |
// We use this to control the maximum number of block grid elements per row | |
$block-grid-elements: 12 !default; |
This runs provides an .optim job for dragonfly and also adds the .optim job into .thumb
This requires you have the 'image_optim' gem and it's dependencies.
/* @author 14islands.com | |
* SASS mixins for future proof resolution media query | |
*/ | |
@mixin if-min-resolution($dppx) { | |
@include if-resolution(min, $dppx) { | |
@content; | |
} | |
} |
/usr/libexec/PlistBuddy -c 'Add :LSUIElement bool true' /Applications/iTerm.app/Contents/Info.plist |
<?php | |
/** | |
* Get first paragraph from a WordPress post. Use inside the Loop. | |
* | |
* @return string | |
*/ | |
function get_first_paragraph(){ | |
global $post; | |
$str = wpautop( get_the_content() ); |
require 'resolv' | |
class EmailValidator < ActiveModel::EachValidator | |
def validate_each(record, attribute, value) | |
if Resolv::DNS.new.getresources(value.split("@").last, Resolv::DNS::Resource::IN::MX).empty? | |
record.errors[attribute] << (options[:message] || "does not have a valid domain") | |
end | |
rescue Resolv::ResolvError, Resolv::ResolvTimeout | |
record.errors[attribute] << (options[:message] || "does not have a valid domain") | |
end |
var scheduled = false, | |
_throttleDelay = 200; | |
function ScrollHandler(e) { | |
//throttle event: | |
if (!scheduled) { | |
scheduled = true; | |
setTimeout(function () { | |
console.log('scroll'); |
class MyCustomCell < UITableViewCell | |
# This method is used by ProMotion to instantiate cells. | |
def initWithStyle(style_name, reuseIdentifier: reuseIdentifier) | |
super | |
stylish | |
self | |
end | |
# A delegate method when the user clicks the Row(it's blue by default) |