Skip to content

Instantly share code, notes, and snippets.

View CodingItWrong's full-sized avatar

Josh Justice CodingItWrong

View GitHub Profile
@CodingItWrong
CodingItWrong / Vagrantfile
Created May 22, 2017 12:49
Vapor Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.network "forwarded_port", guest: 8080, host: 8082, host_ip: "127.0.0.1"
config.vm.synced_folder ".", "/app"
config.vm.provision "shell", inline: <<-SHELL
eval "$(curl -sL https://apt.vapor.sh)"
sudo apt-get -y install swift vapor postgresql postgresql-contrib
@CodingItWrong
CodingItWrong / NSRegularExpression+ActuallyReasonableMatch.swift
Created May 4, 2017 19:29
NSRegularExpression+ActuallyReasonableMatch.swift
extension NSRegularExpression {
func actuallyUsableMatch(in string: String) -> (fullMatch: String, captures: [String])? {
let nsString = string as NSString
let range = NSMakeRange(0, nsString.length)
guard let match = firstMatch(in: string, range: range) else {
return nil
}
let fullMatch = nsString.substring(with: match.range)
var captures: [String] = []
@CodingItWrong
CodingItWrong / .rubocop.yml
Last active September 6, 2016 19:24
My Rubucop Settings
# https://github.com/bbatsov/rubocop/blob/master/config/default.yml
AllCops:
TargetRubyVersion: 2.2
# Don't check Ruby files that aren't application code
Exclude:
- 'Gemfile'
- 'Rakefile'
- 'bin/**/*'
- 'config/**/*'
vagrant@homestead:~/code/learntdd.in/laravel$ phpunit
PHPUnit 4.8.26 by Sebastian Bergmann and contributors.
F
Time: 4.32 seconds, Memory: 12.00MB
There was 1 failure:
1) CreatingABlogPostTest::testCreatingABlogPost
def render_with_block(partial)
render partial, yielded: capture { yield }
end