Skip to content

Instantly share code, notes, and snippets.

View vcavallo's full-sized avatar

Vinney Cavallo ~sogrum-savluc vcavallo

View GitHub Profile
vcavallo /
Last active August 25, 2020 09:01
rails + webpacker + webpack-dev-server + vue + remote dev vps and nginx

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 /
Created June 14, 2018 19:30
remote dev VPS webpack-dev-server nginx setup

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 = {

Keybase proof

I hereby claim:

  • I am vcavallo on github.
  • I am vcavallo ( on keybase.
  • I have a public key ASAA6bamIo8LhRq8sehFLen9QC5WqQNkIWZQ9cx9rk5t0go

To claim this, I am signing this object:

vcavallo / vim-centerpane
Last active October 19, 2017 03:19
vimscript function to center a lone pane in the window
" 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)
" optionally map it to a key:
vcavallo / version.rake
Created December 6, 2016 19:49 — forked from muxcmux/version.rake
Manage your rails app version with this rake task
def valid? version
pattern = /^\d+\.\d+\.*\d*(\-(dev|beta|rc\d+))?$/
raise "Tried to set invalid version: #{version}".red unless version =~ pattern
def correct_version version
ver, flag = version.split '-'
v = ver.split '.'
(0..2).each do |n|
v[n] = v[n].to_i
vcavallo /
Last active December 10, 2015 18:49
Creating an agile project from a "template" in jira

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:
  7. issue types
vcavallo / questions-for-employers.txt
Created September 21, 2015 18:36
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.
Comments: " 10 questions to ask your potential employer"
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 / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
vcavallo / gist:80f01ad6fb4b90993dfd
Created December 8, 2014 21:37
password protect any site without devise users
class AnyController < ApplicationController
# HTTP authentication should be used for staging to prevent unauthorized outside access to application.
before_filter :authenticate if Rails.env.staging?
def authenticate
authenticate_or_request_with_http_basic do |user,pass|
user == "usernamehere" && pass == "passwordhere"
vcavallo / databasecleaner_config.rb
Created April 4, 2014 18:52
database cleaner configuration
# 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