Short Url: http://caseywatts.com/chromeextensionworkshop
Alternate Short Url: http://tinyurl.com/blatant-panda
Other gists & tricks: http://caseywatts.com/gists-and-tricks
- Inspiration - Some Chrome Extensions to Inspire You
module MongoidEmbeddedObjectModification | |
# Custom field behaves more like an immutable value. | |
# Your changes to the object obtained with getter method will not take an effect unless you assign it back. | |
# https://github.com/mongoid/mongoid/issues/3341 | |
def modify(mongoid_doc, field_name) | |
obj = mongoid_doc.public_send(field_name) | |
yield obj | |
mongoid_doc.public_send("#{field_name}=", obj) | |
end |
Short Url: http://caseywatts.com/chromeextensionworkshop
Alternate Short Url: http://tinyurl.com/blatant-panda
Other gists & tricks: http://caseywatts.com/gists-and-tricks
Medium uses a strict subset of LESS for style generation. This subset includes variables and mixins, but nothing else (no nesting, etc.).
Medium's naming conventions are adapted from the work being done in the SUIT CSS framework. Which is to say, it relies on structured class names and meaningful hyphens (i.e., not using hyphens merely to separate words). This is to help work around the current limits of applying CSS to the DOM (i.e., the lack of style encapsulation) and to better communicate the relationships between classes.
Table of contents
'use strict'; | |
//npm install gulp gulp-minify-css gulp-uglify gulp-clean gulp-cleanhtml gulp-jshint gulp-strip-debug gulp-zip --save-dev | |
var gulp = require('gulp'), | |
clean = require('gulp-clean'), | |
cleanhtml = require('gulp-cleanhtml'), | |
minifycss = require('gulp-minify-css'), | |
jshint = require('gulp-jshint'), | |
stripdebug = require('gulp-strip-debug'), |
# Run Guard normally. This Guardfile defines 2 groups: | |
# 1) default: This is the default group and will run all appropriate specs when anything changes. | |
# 2) focus: This is the group you want when you are focusing on a specific spec or context of specs. When in this | |
# scope Guard will only run specs tagged with :focus. | |
# | |
# Example: | |
# context "GET on :index, /", focus: true do | |
# ... | |
# end | |
# |
/* | |
* Set up factories, then create them in tests with (for example): | |
* | |
* LineItemFactory(); | |
* | |
* Or with attributes / overrides: | |
* | |
* LineItemFactory({ | |
* "id": 123, | |
* "order": OrderFactory({"firstName": "Example Associated Record Override"}), |
@-webkit-keyframes bgcolor { 0% { background-color: #ffccf2; } | |
50% { background-color: #ccffcc; } | |
100% { background-color: #ccffff; } } | |
@-moz-keyframes bgcolor { 0% { background-color: #ffccf2; } | |
50% { background-color: #ccffcc; } | |
100% { background-color: #ccffff; } } | |
@-ms-keyframes bgcolor { 0% { background-color: #ffccf2; } | |
50% { background-color: #ccffcc; } |
require 'rubygems' | |
def start_simplecov | |
require 'simplecov' | |
SimpleCov.start 'rails' unless ENV["SKIP_COV"] | |
end | |
def spork? | |
defined?(Spork) && Spork.using_spork? | |
end |
<div id="myform"> | |
First name: <input type="text" name="fname" id="fname" /><br /> | |
Last name: <input type="text" name="lname" id="lname" /><br /> | |
<%= link_to "Foo", {:action => "filter", :filter => "filter1"}, {:remote => true, :method =>:get , "data-submit" => "#myform input"} %> | |
</div> | |
<script type="text/javascript" charset="utf-8"> |