Skip to content

Instantly share code, notes, and snippets.

Vinney Cavallo vcavallo

Block or report user

Report or block vcavallo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vcavallo
vcavallo / notes.md
Last active Dec 2, 2019
rails + webpacker + webpack-dev-server + vue + remote dev vps and nginx
View notes.md

Process goes something like this:

bundle update webpacker
rails webpacker:binstubs
yarn upgrade @rails/webpacker@4.0.0-pre.2 # or 'add' instead of upgrade
yarn upgrade webpack-dev-server@"'3.1.4'  # or 'add' instead of upgrade
yarn add webpack-cli

bundle exec rails webpacker:install # don't do this! the scrpit seems to overwrite the @rails/webpacker version to 3.5.3
@vcavallo
vcavallo / explanation.md
Created Jun 14, 2018
remote dev VPS webpack-dev-server nginx setup
View explanation.md

Remote Dev machine webpack-dev-server HMR + static serving combo

Make sure you have port 8080 (or whatever you use) open on the remote machine!! Don't be like Vinney.

I'm no webpack expert (in fact this is the first project I've set up by hand ever...), but if you know what you're doing you should be able to change the relevant parts of this to fit your project:

# webpack.config.js

module.exports = {
View keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@vcavallo
vcavallo / vim-centerpane
Last active Oct 19, 2017
vimscript function to center a lone pane in the window
View vim-centerpane
" centers the current pane as the middle 2 of 4 imaginary columns
" should be called in a window with a single pane
function CenterPane()
lefta vnew
wincmd w
exec 'vertical resize '. string(&columns * 0.75)
endfunction
" optionally map it to a key:
@vcavallo
vcavallo / version.rake
Created Dec 6, 2016 — forked from muxcmux/version.rake
Manage your rails app version with this rake task
View version.rake
def valid? version
pattern = /^\d+\.\d+\.*\d*(\-(dev|beta|rc\d+))?$/
raise "Tried to set invalid version: #{version}".red unless version =~ pattern
end
def correct_version version
ver, flag = version.split '-'
v = ver.split '.'
(0..2).each do |n|
v[n] = v[n].to_i
@vcavallo
vcavallo / jira-agile-setup.md
Last active Dec 10, 2015
Creating an agile project from a "template" in jira
View jira-agile-setup.md

Setting up a new Agile Scrum project in Jira

  1. create new project
  2. choose "scrum software development"
  3. click 'select' on the next screen to use the default issue type for now
  4. choose a name and project lead
  5. go to 'project administration' (this option is in different places depending on your view)
  6. you should be viewing the summary now. do these:
    1. issue types
@vcavallo
vcavallo / questions-for-employers.txt
Created Sep 21, 2015
this is an archive of a blog post that i had saved to newsblur back when it was posted. it appears the post has since been taken down or moved.
View questions-for-employers.txt
Comments: "stefankendall.com: 10 questions to ask your potential employer"
URL: http://www.stefankendall.com/2013/11/10-questions-to-ask-your-potential.html
The interview is all too often driven by the employer. Can you handle this workload? What are your strengths and weaknesses? How do you feel about this aspect of the business?
But at the end of the interview, you do not know enough to know if you will actually love and enjoy the work. How many developers or designers do you know who have worked at a place for less than a year? Less than 9 months? I bet more than a few.
Here's some questions you should ask before committing a significant portion of your life to a company.
@vcavallo
vcavallo / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@vcavallo
vcavallo / gist:80f01ad6fb4b90993dfd
Created Dec 8, 2014
password protect any site without devise users
View gist:80f01ad6fb4b90993dfd
class AnyController < ApplicationController
# HTTP authentication should be used for staging to prevent unauthorized outside access to application.
before_filter :authenticate if Rails.env.staging?
private
def authenticate
authenticate_or_request_with_http_basic do |user,pass|
user == "usernamehere" && pass == "passwordhere"
@vcavallo
vcavallo / databasecleaner_config.rb
Created Apr 4, 2014
database cleaner configuration
View databasecleaner_config.rb
# spec_helper.rb
RSpec.configure do |config|
# earlier configurations omitted ...
# Set config.use_transactional_fixtures to false
config.use_transactional_fixtures = false
config.before(:suite) do
DatabaseCleaner.strategy = :truncation
You can’t perform that action at this time.