Skip to content

Instantly share code, notes, and snippets.

View vcavallo's full-sized avatar

Vinney Cavallo ~sogrum-savluc vcavallo

View GitHub Profile
@vcavallo
vcavallo / explanation.md
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 = {
@vcavallo
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
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 / notes.md
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
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)
endfunction
" optionally map it to a key:

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 / github_repo_from_cli.md
Last active January 8, 2017 06:06
Create a GitHub repo from the CLI (plus bash function)

Create GitHub repo without leaving the command line

curl -u 'USER' https://api.github.com/user/repos -d '{"name":"REPO"}'

Replace USER with your username and REPO with the intended repo name. Include all quotes above.

The do the usual:

git remote add origin git@github.com:USER/REPO.git

git push origin master

@vcavallo
vcavallo / fork_you.markdown
Last active December 24, 2015 00:09
Forking how-to with descriptions

Forking

essentially like cloning on github's servers - but that's inconsequential, mostly.. also: forks are not automatically up to date (relative to repo you forked)! your fork creates a snapshot of the original repo at the time you fork it.

  • fork on github

  • creates a clone on github servers

  • copy url of that clone

  • git clone [url]

    • clones the content of your fork to your local machine
@vcavallo
vcavallo / cs
Created September 24, 2013 20:25
CS function for bash profile - `cs ~/directory` does `cd` to ~/directory and then immediately does `ls` there (well, a fancy ls...).
# CS function
function cs () {
cd $1; ls "-lahG"
}
@vcavallo
vcavallo / alien_sandwich_vcavallo.md
Last active December 23, 2015 19:09
Alien Sandwich

items in front of you

jar is an object in front of you. It is tall and from above looks like a circle.

a jar has stuff in it. there can be either peanut butter, which is brown in color, or jelly, which is purple in color. peanut butter jar and jelly jar. a jar has three parts - the inner stuff is one, and the outer stuff is in two pieces: the top and the bottom. you can see the division between the two parts. the bottom is the part that is facing down, the top is facing up.

bag of bread is an object in front of you. it has two parts - an outer container and an inner material. the bag is the container and what is inside in the bread. there are many nearly-identical items that are all bread. they are individually called slices. a slice of bread is an individual item.

knife is another object in front of you. it is the only remaining object. it is silver in color and has the shape of a wide line. there are two ends to it handle and blade. the handle is the thicker end. the blade

@vcavallo
vcavallo / jira-agile-setup.md
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