Skip to content

Instantly share code, notes, and snippets.

View cmaujean's full-sized avatar

Christopher Maujean cmaujean

  • Mostly here, but sometimes elsewhere
View GitHub Profile
@cmaujean
cmaujean / setup.sh
Created July 1, 2021 19:32 — forked from Sitin/setup.sh
Run x86-64 Docker images on Raspberry Pi 4 (QEMU/QUS)
# Setup QEMU for x86-64 Docker images on Raspberry Pi 4
# Install Python3 and Docker first: https://dev.to/rohansawant/installing-docker-and-docker-compose-on-the-raspberry-pi-in-5-simple-steps-3mgl
# Install QUEMU (https://www.qemu.org/)
sudo apt-get install qemu binfmt-support qemu-user-static
# Use QUS in Docker (https://github.com/dbhi/qus) to configure x86_64 architecture
docker run --rm --privileged aptman/qus -s -- -p x86_64
# Test x86-64 image:
@cmaujean
cmaujean / Rakefile
Created July 14, 2012 01:24 — forked from adzap/Rakefile
# Get your spec rake tasks working in RSpec 2.0
require 'rspec/core/rake_task'
desc 'Default: run specs.'
task :default => :spec
desc "Run specs"
RSpec::Core::RakeTask.new do |t|
t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
require 'sinatra'
get '/process' do
erb :process
end
@cmaujean
cmaujean / capybara_select_dates_and_times.rb
Created June 7, 2011 20:03
A rollup of various Capybara date/time step definition gists, updated for Capybara 0.4.1.2 and XPath 0.1.3
require "xpath" # XPath is a separate gem now
module Cucumber
module Rails
module CapybaraSelectDatesAndTimes
def select_date (date, options = {})
date = Date.parse(date)
# lookup id prefix by label
id_prefix = id_prefix_for(options[:label])
desc "Regenerates a rails 3 app for testing"
task :test_app do
SPREE_PATH = ENV['SPREE_PATH']
raise "SPREE_PATH should be specified" unless SPREE_PATH
require File.join(SPREE_PATH, 'lib/generators/spree/test_app_generator')
class FlagPromotionTestAppGenerator < Spree::Generators::TestAppGenerator
def tweak_gemfile
append_file 'Gemfile' do
<<-gems