Skip to content

Instantly share code, notes, and snippets.

Working from home on open source

Daniel P. Clark danielpclark

Working from home on open source
View GitHub Profile

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
View Webpacker config Rails 6 VueJS vue-loader

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.


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

environment.loaders.append('vue', vue)
View Favorite Ruby

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
View dind
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
View gotham.deps
apt-get update
apt-get install ruby nodejs curl build-essential ruby-dev libxml2-dev
curl -sS | apt-key add -
echo "deb stable main" | tee /etc/apt/sources.list.d/yarn.list
apt-get update && apt-get install yarn
curl -sSf | sh
source $HOME/.cargo/env
export USER=root
gem install bundler rake webpacker_cli
# After 1 Day


Tell Garbage Collector which objects you use. Ruby takes care of object lifecycle; C doesn't. If you still need objects, mark them in use.

void mark(void* p) {
  auto* hash = reinterpret_cast<ruby_hash_t*>(p);
danielpclark /
Created May 11, 2018
Started writing AES file parser. Doing a rewrite with `nom` so this is for reference.
extern crate byteorder;
use byteorder::{BigEndian,ByteOrder};
use std::io::prelude::*;
use std::fs::File;
use std::str;
// 3 Octets - 'AES'
// 1 Octet - 0x02 (Version)
// 1 Octet - Reserved (set to 0x00)
// .... Start of repeating extension block section
View flicker.html
.ebb-bottom {
background-image: url(;
background-size: 400px 400px;
.images > div {
float: left;
width: 400px;
View test_relative_path_from.rb
require 'test_helper'
class RelativePathFromTest < Minitest::Test
def test_relative_path_from
assert_equal FasterPath.relative_path_from("a", "b").to_s, "../a"
assert_equal FasterPath.relative_path_from("a", "b/").to_s, "../a"
assert_equal FasterPath.relative_path_from("a/", "b").to_s, "../a"
assert_equal FasterPath.relative_path_from("a/", "b/").to_s, "../a"
assert_equal FasterPath.relative_path_from("/a", "/b").to_s, "../a"
assert_equal FasterPath.relative_path_from("/a", "/b/").to_s, "../a"
assert_equal FasterPath.relative_path_from("/a/", "/b").to_s, "../a"