Skip to content

Instantly share code, notes, and snippets.

View Lordnibbler's full-sized avatar

Ben Radler Lordnibbler

View GitHub Profile
@Lordnibbler
Lordnibbler / pull-request-template.md
Last active October 20, 2022 17:32
Sample Pull Request Template

Status

READY/IN DEVELOPMENT/HOLD

Migrations

YES | NO

Description

A few sentences describing the overall goals of the pull request's commits.

Related PRs

RSpec::Matchers.define :have_meta do |name, expected|
match do |actual|
has_css?("meta[name='#{name}'][content='#{expected}']")
end
failure_message_for_should do |actual|
actual = first("meta[name='#{name}']")
if actual
"expected that meta #{name} would have content='#{expected}' but was '#{actual[:content]}'"
else
class DomainConstraint
def initialize(domain)
@domains = [domain].flatten
end
def matches?(request)
request.subdomain.present? ? domain_to_match = request.subdomain + "." + request.domain : domain_to_match = request.domain
@domains.include? domain_to_match
end
end
@Lordnibbler
Lordnibbler / alfred_snippets.txt
Created August 15, 2015 08:06
Alfred Snippets
# <name> / <snippet>
# dnsmasq
edit dnsmasq.conf / vi /usr/local/etc/dnsmasq.conf
kill dnsmasq / sudo killall -9 dnsmasq
load dnsmasq / sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
unload dnsmasq / sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
flush DNS caches / sudo discoveryutil udnsflushcaches
# git/hub

How to use BLHeli Suite on Mac OS X

  1. download & install winebottler

  2. save list of devices connected to computer

ls /dev/* > /tmp/usbtmp1
  1. plug in quadcopter over USB
### Keybase proof
I hereby claim:
* I am lordnibbler on github.
* I am benradler (https://keybase.io/benradler) on keybase.
* I have a public key ASAKKxWxSHzl2ssgBqohxuLfxqzlAsxcUb9mp-zxRXExGwo
To claim this, I am signing this object:
def is_page?(page)
if params
params["id"] == page && params["controller"] == "high_voltage/pages"
else
false
end
end
"shipments": [
{
"id": 1053930574,
"tracking": null,
"number": "H36015558751",
"cost": "0.0",
"shipped_at": null,
"state": "pending",
"order_id": "R644681243",
"stock_location_name": "California Fulfillment Center",
# This migration comes from spree (originally 20130802022321)
class MigrateTaxCategoriesToLineItems < ActiveRecord::Migration
def change
Spree::LineItem.includes(:variant => { :product => :tax_category }).find_in_batches do |line_items|
line_items.each do |line_item|
next if line_item.variant.nil?
next if line_item.variant.product.nil?
next if line_item.product.nil?
line_item.update_column(:tax_category_id, line_item.product.tax_category.id)
end
require 'spec_helper'
describe "Locations", js: true do
describe "Dealer locator search returns relevant locations" do
it "should return test location" do
location = FactoryGirl.create(:location)
visit "/store/dealer-locator"
fill_in "search", with: "Castro Valley, CA"
click_on "Search"