Skip to content

Instantly share code, notes, and snippets.

View lrjbrual's full-sized avatar
🏠
Working from home

ryanjeff lrjbrual

🏠
Working from home
View GitHub Profile
<%= render 'friends/lookup' %>
<% if @friendships.size > 0 %>
<table class="table table-striped">
<thead>
<tr>
<th colspan="3" class="page-header">
<h2>My Friends</h2>
</th>
</tr>
<tr>
@lrjbrual
lrjbrual / solution_robocop_string_interpolation.rb
Last active April 26, 2016 14:01
Solution for Interpolation .to_s ("String") via Robocop
======= Problem with codes using interpolation #{url}====
lapse Offence from Robocop: C: 12: 32: Prefer to_s over string interpolation.
-------------------------
require 'nokogiri'
require 'open-uri'
class Browser
attr_accessor :url
def initialize
@lrjbrual
lrjbrual / gist:cc507ee57d1ae5ae1c21371d1e992940
Created December 28, 2016 16:55 — forked from johnantoni/gist:07df65898456ace4307d5bb6cbdc7f51
Nginx, PHP-FPM, MySQL and phpMyAdmin on OS X

This is my take on how to get up and running with NGINX, PHP-FPM, MySQL and phpMyAdmin on OSX Yosemite.

This article is adapted from the original by Jonas Friedmann. Who I just discovered is from Würzburg in Germany. A stonesthrow from where I was born ;)

Xcode

Make sure you have the latest version of XCode installed. Available from the Mac App Store.

Install the Xcode Command Line Tools:

xcode-select --install

@lrjbrual
lrjbrual / iterm2-solarized.md
Created January 24, 2017 21:48 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@lrjbrual
lrjbrual / gist:e8e6c2b5debd04dde16786d0e8124edc
Created January 25, 2017 15:45
Artisan serve got error
✝  ~/code/locksourcing/trendle   master  ls
app composer.json database public routes tests
artisan composer.lock package.json readme.md server.php webpack.mix.js
bootstrap config phpunit.xml resources storage
✝  ~/code/locksourcing/trendle   master  php artisan serve
sPHP Warning: require(/Users/ryanjeff/code/locksourcing/trendle/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /Users/ryanjeff/code/locksourcing/trendle/bootstrap/autoload.php on line 17
PHP Stack trace:
PHP 1. {main}() /Users/ryanjeff/code/locksourcing/trendle/artisan:0
PHP 2. require() /Users/ryanjeff/code/locksourcing/trendle/artisan:16
How to:
1. Generate in command line: rails new -T --database postgresql capstone1asyourprojectname
2. rails db:create
3. rails db:migrate
4. add to your gem file
gem 'spree', '~> 3.2.0.rc1'
gem 'spree_auth_devise', '~> 3.2.0.beta'
gem 'spree_gateway', '~> 3.2.0.beta'
5. run bundle update
6. then copy paste these in to your command line:
@lrjbrual
lrjbrual / notes.md
Created May 6, 2017 19:27 — forked from sixfeetover/notes.md
MacOS Sierra upgrade for Rubyists

Upgrading to Sierra for Ruby Devs

Often when upgrading to the latest OS X MacOS you have to do a few things to account for changing to underlying libraries. Here are the post-upgrade steps I took to get back to a fully operational state. I use homebrew and rbenv to manage my environment.

1. Get your Developer Command line tools upgraded.

To do this just run

$ xcode-select --install
@lrjbrual
lrjbrual / Middleman Deploy Error
Created May 19, 2016 19:29
When uploading to git using middleman deploy error can't find gem middleman -cli (>= 0.a)
Need Help, When I tried to deploying the middleman application that I created I got some error here's the details:
➜ rj-profile git:(master) ✗ bundle exec middleman build
/Users/ryanjeff/.rbenv/versions/2.3.0/lib/ruby/site_ruby/2.3.0/rubygems.rb:250:in `find_spec_for_exe': can't find gem middleman
-cli (>= 0.a) (Gem::GemNotFoundException)
from /Users/ryanjeff/.rbenv/versions/2.3.0/lib/ruby/site_ruby/2.3.0/rubygems.rb:278:in `activate_bin_path'
from /Users/ryanjeff/.rbenv/versions/2.3.0/bin/middleman:22:in `<main>'
➜ rj-profile git:(master) ✗ middleman deploy
run middleman build from "."
/Users/ryanjeff/.rbenv/versions/2.3.0/lib/ruby/site_ruby/2.3.0/rubygems.rb:250:in `find_spec_for_exe': can't find gem middleman
@lrjbrual
lrjbrual / _input.blade.php
Created February 15, 2018 12:37
master branch
<?php
foreach($mkpdata as $key=>$d){
$mkpid=$d->marketplace_id;
$sid_token[$mkpid]['sid']=$d->mws_seller_id;
$sid_token[$mkpid]['token']=$d->mws_auth_token;
$remove_state[$mkpid] = '';
$verified_state[$mkpid] = '';
if(!isset($sid_token[$mkpid]['sid'])){
$sid_token[$mkpid]['sid']='';
@lrjbrual
lrjbrual / postgres-cheatsheet.md
Created February 21, 2018 19:42 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)