Skip to content

Instantly share code, notes, and snippets.

View CodingItWrong's full-sized avatar

Josh Justice CodingItWrong

View GitHub Profile
def render_with_block(partial)
render partial, yielded: capture { yield }
end
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
@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/**/*'
@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

Keybase proof

I hereby claim:

  • I am codingitwrong on github.
  • I am codingitwrong (https://keybase.io/codingitwrong) on keybase.
  • I have a public key ASDg0SmMj4CQv4JcvGN4kZAJEQb7MaWhgCWdxyPmJYRaZwo

To claim this, I am signing this object:

@CodingItWrong
CodingItWrong / app.js
Last active June 28, 2017 18:39
import/export in node
import message from './mymodule';
console.log(message);
@CodingItWrong
CodingItWrong / App.vue
Created June 29, 2017 19:59
Vue.js One-Way Data Binding
<template>
<div id="app">
<ul>
<li v-for="string in strings">
{{string}}
</li>
</ul>
<ul>
<li v-for="(string, index) in strings">
<togglable-text-input v-bind:string="string" v-bind:index="index" v-on:updateString="handleUpdateString" />
@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] = []
const { reloadApp } = require('detox-expo-helpers');
describe('Creating a message', () => {
beforeEach(async () => {
await reloadApp();
});
it('should add the message to the list', async () => {
await element(by.id('messageText')).tap();
await element(by.id('messageText')).typeText('New message');
import {
View,
} from 'react-native';
+import NewMessageForm from './NewMessageForm';
export default class App extends Component {
render() {
return (
<View>
+ <NewMessageForm />