Skip to content

Instantly share code, notes, and snippets.

Brian Pattison brianpattison

Block or report user

Report or block brianpattison

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@brianpattison
brianpattison / README.md
Last active Jan 27, 2017
Simple Scheduler Proposal (README first development)
View README.md

This was the initial proposal for Simple Scheduler in the form of a README. The goal was to come up with a project that didn't exist, but solved all of our problems right in the README. And then write the code.

You can now find the actual README and the project here:

https://github.com/simplymadeapps/simple_scheduler

--

Simple Scheduler

@brianpattison
brianpattison / README.md
Last active Feb 13, 2016
Broccoli.js Sass compiling with glob imports
View README.md

EXPERIMENTAL

The Rails asset pipeline has SCSS glob imports. Why isn't this possible everywhere? I made it possible with Broccoli.js.

SCSS

// web/static/css/admin.scss
@import "admin/variables";
@brianpattison
brianpattison / has_columns.scss
Last active Jan 12, 2016
"Has Columns" Flexbox SCSS Mixin
View has_columns.scss
// Sets up a element and its child elements with the flexbox properties needed
// to have the given number of columns with optional gutters or margins.
$mobile-breakpoint: 500px !default;
@mixin has-columns($columns, $gutter: 0, $margin: 0) {
@include align-content(stretch);
@include align-items(stretch);
@include display(flex);
@include flex-direction(row);
@include flex-wrap(wrap);
View center_children.scss
// Centers child elements horizontally and vertically without needing
// to set the height and width of the child elements using flexbox.
@mixin center-children {
@include align-content(center);
@include align-items(center);
@include display(flex);
@include flex-direction(column);
@include justify-content(center);
}
@brianpattison
brianpattison / filter.rb
Last active Dec 22, 2015
JSON API Resources Filtering
View filter.rb
filter :before, apply: -> (records, value, _options) do
records.where("shop_orders.order_datetime < ?", value)
end
filter :after, apply: -> (records, value, _options) do
records.where("shop_orders.order_datetime > ?", value)
end
@brianpattison
brianpattison / README.md
Last active Aug 29, 2015
Google Material Design: Sass Color Function
View README.md
@brianpattison
brianpattison / Gemfile
Last active May 9, 2017
Rails Livereload
View Gemfile
source "https://rubygems.org"
ruby "2.2.2"
gem "rails", "4.2.0"
group :development do
gem "foreman"
gem "guard-livereload", require: false
gem "rack-livereload"
end
View spaces.rb
hash = {
aligning: "key/values",
is: "so much",
easier: "with spaces"
}
View jamon_hash.rb
class JamonHash < HashWithIndifferentAccess
def default(key = nil)
if key.is_a?(String) && key.include?(".")
find_value(key.split("."))
else
super
end
end
def find_value(keys)
@brianpattison
brianpattison / README.md
Last active Aug 29, 2015
MenuMotion Proposal
View README.md

MenuMotion

MenuMotion is a RubyMotion wrapper inspired by Formotion for creating OS X status bar menus with a syntax that should feel familiar if you've used Formotion.

Installation

Add this line to your application's Gemfile:

gem "menu-motion"
You can’t perform that action at this time.