Skip to content

Instantly share code, notes, and snippets.

View danielpclark's full-sized avatar
✍️
Working from home on open source

Daniel P. Clark danielpclark

✍️
Working from home on open source
View GitHub Profile
# Proof of Concept
class ArrayifyBehavior
def initialize(data)
@data = data
end
def self.call(data)
new(data)
end
function rvm --description='Ruby enVironment Manager'
# run RVM and capture the resulting environment
set --local env_file (mktemp -t rvm.fish.XXXXXXXXXX)
bash -c 'PATH=$GEM_HOME/bin:$PATH;RVMA=$(which rvm);RVMB=$(whereis rvm | sed "s/rvm://");source $(if test $RVMA;then echo $RVMA | sed "s/bin/scripts/";elif test $RVMB; then echo $RVMB | sed "s/rvm/rvm\/scripts\/rvm/"; else echo ~/.rvm/scripts/rvm; fi); rvm "$@"; status=$?; env > "$0"; exit $status' $env_file $argv
# apply rvm_* and *PATH variables from the captured environment
and eval (grep -E '^rvm|^[^=]*PATH|^GEM_HOME' $env_file | grep -v '_clr=' | sed '/^[^=]*PATH/s/:/" "/g; s/^/set -xg /; s/=/ "/; s/$/" ;/; s/(//; s/)//')
# needed under fish >= 2.2.0
and set -xg GEM_PATH (echo $GEM_PATH | sed 's/ /:/g')
git clone https://github.com/vim/vim.git
cd vim
./configure --with-features=huge \
--enable-multibyte \
--enable-rubyinterp=yes \
--enable-python3interp=yes \
--with-python-config-dir=$(python3-config --configdir) \
--enable-perlinterp=yes \
--enable-luainterp=yes \
--enable-gui=gtk2 \

All of the following commands are to be run on the remote machine where the files to copy are

We need a key to connect with SSH

ssh-keygen -t rsa -b 4096

Put that pub key in the destination machine's ~/.ssh/authorized_keys

(asuming destination SSH is up and configured for accepting keys)

cat ~/.ssh/id_rsa.pub

Merging a PR in to develop

Using a branch named EXAMPLE_BRANCH:

git checkout develop
git fetch --all
git rebase origin/develop
git checkout EXAMPLE_BRANCH
git rebase develop

At the moment upgrading vue-loader causes some changes in how things are done. These are my config options for these items just to get it working.

config/webpack/environment.js

const { environment } = require('@rails/webpacker')
const coffee = require('./loaders/coffee')
const vue = require('./loaders/vue')

environment.loaders.append('vue', vue)

Favorite Ruby Gems

Gem Description
annotate_models writes the model schema to the model tests and app model files as comments.
arbre an Object Oriented DOM Tree in Ruby
arel a relational algebra
benchmark-ips provides iteration per second benchmarking for Ruby
byebug Rails' default debug tool of choice
churn the history of churns to give the number of times a file, class, or method is changing during the life of a project
coveralls online service for code coverage
The following configuration doesn't work.
docker run -d --name gitlab-dind --privileged --restart always --network gitlab-runner-net -v /var/lib/docker -v /etc/gitlab-runner:/etc/gitlab-runner -v /var/run/docker.sock:/var/run/docker.sock docker:18.06.1-ce-dind --storage-driver=overlay2
docker run -d --name gitlab-runner --restart always --network gitlab-runner-net -v /etc/gitlab-runner:/etc/gitlab-runner -e DOCKER_HOST=tcp://gitlab-dind:2375 gitlab/gitlab-runner:alpine
docker run -it --rm -v /etc/gitlab-runner:/etc/gitlab-runner gitlab/gitlab-runner:alpine register --executor docker --docker-image docker:18.06.1-ce --docker-volumes /var/run/docker.sock:/var/run/docker.sock
apt-get update
apt-get install ruby nodejs curl build-essential ruby-dev libxml2-dev
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
apt-get update && apt-get install yarn
curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
export USER=root
gem install bundler rake webpacker_cli