Skip to content

Instantly share code, notes, and snippets.

View carld's full-sized avatar
🔜

Carl carld

🔜
View GitHub Profile

Mounting VirtualBox shared folders on Ubuntu Server 18.04 LTS (Bionic Beaver)

This guide will walk you through the steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest.

Prerequisites

This guide assumes that you are using the following setup:

You could still make this guide work with other setups (possibly with some modifications to the commands and whatnot).

@carld
carld / commit-author.sh
Created June 27, 2023 08:15 — forked from raineorshine/commit-author.sh
Set git commit author for a single repository
git config user.name "ShapeShift-Public"
git config user.email "[email protected]"
https://help.github.com/articles/setting-your-username-in-git/#setting-your-git-username-for-a-single-repository
@carld
carld / lazy_reduce.rb
Created April 12, 2023 01:08 — forked from sharplet/lazy_reduce.rb
Lazy `#reduce` and `#join` in Ruby
require "rspec/autorun"
class Enumerator::Lazy
def reduce(*)
Lazy.new([nil]) do |yielder, _|
yielder << super
end
end
def join(separator="")
@carld
carld / .rubocop.yml
Created June 28, 2022 04:22 — forked from jhass/.rubocop.yml
My preferred Rubocop config
AllCops:
RunRailsCops: true
# Commonly used screens these days easily fit more than 80 characters.
Metrics/LineLength:
Max: 120
# Too short methods lead to extraction of single-use methods, which can make
# the code easier to read (by naming things), but can also clutter the class
Metrics/MethodLength:
@carld
carld / gist:f8977d6244eebd0c9ff51ac6c871b268
Created April 17, 2022 22:56 — forked from robertsosinski/gist:2691813
Testing Postgres Listen/Notify using EventMachine
require 'rubygems'
require 'pg'
require 'eventmachine'
module Subscriber
def initialize(pg)
@pg = pg
end
def notify_readable
@carld
carld / app.rkt
Created July 2, 2020 10:52 — forked from RyanKung/app.rkt
Demo: A simple MVC-web-framework implementation with PLT Scheme (Racket)
;;By Jhen Kung, [email protected]
;;app.rkt
#lang racket(require web-server/servlet
web-server/servlet-env
"router.rkt")
(serve/servlet mordor
#:port 8080
#:servlet-path "/"
@carld
carld / tsort.g
Created June 8, 2020 06:27 — forked from hilverd/tsort.g
Topological sort in Graphviz's gvpr
BEGIN {
int visited[node_t];
int visit(node_t n, edge_t e) {
if (visited[n] == 0) {
visited[n] = 1;
for (e = fstin(n); e; e = nxtin(e)) {
visit(e.tail, NULL);
}
@carld
carld / interview-questions.md
Created July 6, 2017 19:49 — forked from jvns/interview-questions.md
A list of questions you could ask while interviewing

A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.

I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.

I'd love comments and suggestions about any of these.

I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.

I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".

@carld
carld / 00_destructuring.md
Created April 5, 2017 05:09 — forked from john2x/00_destructuring.md
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors

@carld
carld / deploy.sh
Created April 4, 2017 05:32 — forked from memphys/deploy.sh
Easy deployment with git and ssh
git archive --format=tar origin/master | gzip -9c | ssh [email protected] "cd /var/www; tar xvzf -"