Skip to content

Instantly share code, notes, and snippets.

View brianpattison's full-sized avatar

Brian Pattison brianpattison

View GitHub Profile
@brianpattison
brianpattison / README.md
Created November 22, 2012 07:41 — forked from tjogin/README.md
PHP on Pow.cx

PHP on Pow.cx

Install Pow

$ curl get.pow.cx | sh

Install PHP with MySQL

$ curl -O https://raw.github.com/gist/4129846/7ae1709453a8a19ce9c030bf41d544dd08d96d85/php.rb

$ mv php.rb brew --prefix/Library/Formula

@brianpattison
brianpattison / Gemfile
Last active March 12, 2021 00:29
Rails Livereload
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
@brianpattison
brianpattison / README.md
Last active January 27, 2017 18:49
Simple Scheduler Proposal (README first development)

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 February 13, 2016 19:04
Broccoli.js Sass compiling with glob imports

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 January 12, 2016 18:50
"Has Columns" Flexbox SCSS Mixin
// 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);
@brianpattison
brianpattison / center_children.scss
Created January 12, 2016 18:35
Center children mixin
// 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 / github_api_stub.rb
Last active January 1, 2016 13:49
Inspecting octokit requests.
# https://github.com/drewbug/RackMotion
class GithubApiStub
def initialize(app)
@app = app
end
def call(request)
status, headers, data = @app.call(request)
@brianpattison
brianpattison / .git config
Last active December 25, 2015 15:59
Dokku command line tool
[core]
...
[remote "dokku"]
url = git@remote:appname
fetch = +refs/heads/*:refs/remotes/dokku/*
<div class="tool-tip">{{title}}</div>
<div class="tool-tip-hover-container">
{{yield}}
</div>
@brianpattison
brianpattison / filter.rb
Last active December 22, 2015 18:07
JSON API Resources Filtering
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