Skip to content

Instantly share code, notes, and snippets.

View vsnguyen's full-sized avatar

Vietson Nguyen vsnguyen

View GitHub Profile
@kubicek
kubicek / Dockerfile
Last active November 10, 2023 13:45
bullettrain with docker-compose with fresh rails in new repo
FROM ruby:3
# based on https://github.com/timbru31/docker-ruby-node/blob/master/3.1/16/Dockerfile
RUN curl -sL https://deb.nodesource.com/setup_17.x | bash -\
&& apt-get update -qq && apt-get install -qq --no-install-recommends \
postgresql-client nodejs redis-tools \
&& apt-get upgrade -qq \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*\
&& npm install -g yarn
@indiesquidge
indiesquidge / subdomain-localhost-rails-5.md
Created January 19, 2016 07:42
how to access subdomains locally with Rails 5

Subdomaining Localhost with Rails 5

I've been following this blog post on how to set up an api-only Rails 5 application. One of the sections talks about creating a subdomain for your api

Rails.application.routes.draw do
  constraints subdomain: "api" do
    scope module: "api" do
@samberic
samberic / amazon-test.clj
Last active December 4, 2017 21:05
Amazon Product Advertising API using Clojure
(ns yswrl.test.swirls.amazon-test
(:use clojure.test)
(:require [yswrl.test.scaffolding :refer :all]
[yswrl.swirls.amazon :as amazon])
(:use clj-http.fake)
(:use yswrl.fake.faker))
(deftest amazon-test
(testing "url Params are in order"
@runexec
runexec / Clojure Does Objects Better.clj.md
Last active June 17, 2020 03:47
Clojure Does Objects Better

Clojure does Objects Better

A hopefully short and concise explanation as to how Clojure deals with Objects. If you already write Clojure, this isn't for you.

You know what an Interface is if you write/read Java or PHP 5+. In Clojure it might be called defprotocol.

user> (defprotocol IABC
        (also-oo [this])
        (another-fn [this x]))

IABC