Skip to content

Instantly share code, notes, and snippets.

View dpritchett's full-sized avatar
🦅
microservice party

Daniel Pritchett ⚡ dpritchett

🦅
microservice party
View GitHub Profile
@dpritchett
dpritchett / button.css.scss
Last active August 29, 2015 13:56
Composable CSS using Sass @extend
@import 'bootstrap';
@import 'font-awesome';
.button {
@extend .btn;
@extend .btn-default;
@extend .btn-large;
&.destroy {
@extend .fa;
[92091.405170] usb 2-2: USB disconnect, device number 4
[92093.458738] usb 2-2: new high-speed USB device number 5 using xhci_hcd
[92093.481483] usb 2-2: New USB device found, idVendor=090c, idProduct=6610
[92093.481495] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[92093.481501] usb 2-2: Manufacturer: MUZEE
[92093.481505] usb 2-2: SerialNumber: AA04012700044
[92093.481811] usb 2-2: ep 0x81 - rounding interval to 128 microframes, ep desc says 255 microframes
[92093.481823] usb 2-2: ep 0x2 - rounding interval to 128 microframes, ep desc says 255 microframes
[92093.484035] usb-storage 2-2:1.0: USB Mass Storage device detected
[92093.484207] scsi9 : usb-storage 2-2:1.0
class DefaultVariantWeightToZero < ActiveRecord::Migration
def up
Spree::Variant.where(weight: nil).each do |v|
v.weight = 0
v.save
end
change_column :spree_variants, :weight, :decimal, precision: 8, scale: 2, default: 0.0
end
# lib/spree/core/permalinks_decorator.rb
module Spree
module Core
module Permalinks
# <client> asked to have permalink generation not use the word 'slash' where
# a '/' is present. Now we just let Spree generate it (via StringEx fwiw)
# and then strip it out.
#
def self.generate_url_slug(name)
# Form buttons allow user to pick a named scope for their order list
def render_with_user_scope(*args)
add_user_scope_to_result_set! if (action == :index)
render_without_user_scope(*args)
end
alias_method_chain :render, :user_scope
Spree::StoreController.class_eval
def unauthorized
super
end
end
# encoding: utf-8
require 'spec_helper'
describe "Gift Cards" do
include_context "custom products"
before(:all) { load "db/seeds/gift_cards.rb" }
before(:each) { visit spree.products_path }
context "purchasing a gift card" do
#---
# Excerpted from "Programming Elixir",
# published by The Pragmatic Bookshelf.
# Copyrights apply to this code. It may not be used to create training material,
# courses, books, articles, and the like. Contact us if you are in doubt.
# We make no guarantees that this code is fit for any purpose. # Visit http://www.pragmaticprogrammer.com/titles/elixir for more book information.
#---
defmodule Parallel do
def pmap(collection, fun) do
me = self
@dpritchett
dpritchett / wercker.yml
Last active August 29, 2015 13:56
Spree + Heroku + Wercker continuous deployment
box: wercker/ubuntu12.04-ruby2.0.0
services:
- wercker/postgresql
build:
steps:
- bundle-install
- rails-database-yml
- script:
name: db:setup
code: bundle exec rake db:setup
> time go build -v .
github.com/lib/pq/oid
github.com/mattn/go-sqlite3
code.google.com/p/go.net/websocket
github.com/joho/godotenv
github.com/lib/pq
github.com/hoisie/web
github.com/dpritchett/go-analyst/connection
github.com/dpritchett/go-analyst
23.98user 0.86system 0:24.98elapsed 99%CPU (0avgtext+0avgdata 304928maxresident)k