Skip to content

Instantly share code, notes, and snippets.

View colby-swandale's full-sized avatar
✌️

Colby Swandale colby-swandale

✌️
View GitHub Profile
@colby-swandale
colby-swandale / gist:6173b0221ad91a2168ef27b5c08dd089
Created May 12, 2017 00:16
bundle exec spec breaking on local
› bin/rspec spec/commands/exec_spec.rb -f progress
Run options: exclude {:rubygems_master=>true, :git=>"=< 2.12.2", :rubygems=>"=< 2.6.8", :ruby=>"=< 2.4.0", :realworld=>true, :sudo=>true}
........................FFFFF.....FFFFF.....FFFFF.....FFFFF.....................*...
Retried examples: 0
Pending: (Failures listed here are expected and do not affect your suite's status)
1) bundle exec `load`ing a ruby file instead of `exec`ing regarding $0 and __FILE__ when the path is relative with a leading ./ relative paths with ./ have absolute __FILE__
@colby-swandale
colby-swandale / Gemfile
Created April 6, 2017 07:05
dsl perf Gemfile
# rubocop:disable Style/StringLiterals
source 'https://rubygems.org'
gem 'will_paginate', "~> 3.0.7"
gem "elasticsearch-model"
gem "elasticsearch-rails", "~> 0.1.7"
gem "faraday"
gem "faraday_middleware"
@colby-swandale
colby-swandale / getting-started.md
Last active March 15, 2017 04:45
Getting started with Ruby

Getting Started with Ruby

Ruby was developed in the mid 90s by Yukihiro Matsumoto, it's an object orientated programming language desgined to be productive, enjoyable to write and make developers happy.

This guide is to help anyone who hasn't or just started writing their first Ruby code. I have added a few resources for beginners a few advanced topics once you're ready to move on.

Resources

Here are some handy begginner guides and resources to getting started with Ruby.

Installing Ruby

Ruby is shipped with a number of operating systems such as MacOS and Ubuntu. But if you're running Windows or a distro of Linux which doesn't ship with Ruby then this guide will help.

@colby-swandale
colby-swandale / Vagrantfile
Created December 9, 2016 23:14
Bundler errors
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provision "shell", privileged: false, inline: <<-SHELL
require 'bundler/inline'
gemfile do
gem 'rack', '~> 2.0'
end
p Rack::VERSION
<html>
<head>
<script>
var xhr = new XMLHttpRequest(),
method = 'GET',
url = 'http://localhost:8000/test.php';
xhr.open(method, url, true);
xhr.onprogress = function() {
class CPU
attr_reader :f
def initialize
@f = 0x00
end
def instruction
if @f & 0x10 == 0x10
# do something
Verifying that +0xcolby is my blockchain ID. https://onename.com/0xcolby
@colby-swandale
colby-swandale / Rails DockerFile
Created October 25, 2015 08:56
Dockerfile with rbenv and ruby-install
FROM ubuntu:latest
MAINTAINER Colby Swandale <colby@taplaboratories.com.au>
# update apt cache and install dependencies
RUN apt-get update && apt-get install git curl build-essential libssl-dev libreadline-dev zlib1g-dev sqlite3 libsqlite3-dev -y
# add app user
RUN adduser --gecos '' --disabled-password app
# set user to app
USER app
# set rbenv, ruby-build bin paths
ENV HOME /home/app
ERROR in ./~/css-loader!./~/sass-loader!./src/global/styles/style.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/SourceSansPro-Regular.eot in /Users/colby/Desktop/Work/facilities-manager/src/global/styles
@ ./~/css-loader!./~/sass-loader!./src/global/styles/style.scss 6:7038-7083 6:7106-7151
ERROR in ./~/css-loader!./~/sass-loader!./src/global/styles/style.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/SourceSansPro-Regular.woff in /Users/colby/Desktop/Work/facilities-manager/src/global/styles
@ ./~/css-loader!./~/sass-loader!./src/global/styles/style.scss 6:7203-7249
ERROR in ./~/css-loader!./~/sass-loader!./src/global/styles/style.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/SourceSansPro-Regular.ttf in /Users/colby/Desktop/Work/facilities-manager/src/global/styles