Skip to content

Instantly share code, notes, and snippets.

View leobessa's full-sized avatar

Leonardo Bessa leobessa

View GitHub Profile
@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
@parmentf
parmentf / GitCommitEmoji.md
Last active April 19, 2025 23:29
Git Commit message Emoji
@TomK32
TomK32 / ledger-envelope-generator.rb
Last active December 27, 2022 19:51
create ledger entries for repeating transactions
#!/bin/env ruby
# (C) 2015 Thomas R. Koll, <[email protected]>
# licensed under WTFPL
#
# This script generates entries for the ledger format.
# Think of it as an envelope generator
require 'highline'
require 'date'
require 'active_support/core_ext/date/calculations'
@OlegIlyenko
OlegIlyenko / Event-stream based GraphQL subscriptions.md
Last active July 4, 2024 07:31
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

@IronSavior
IronSavior / composable_enums_demo.rb
Last active January 20, 2021 01:39
Composable Enumerators in Ruby
# @author Erik Elmore <[email protected]>
# This is getting a little out of hand... :dizzy_face:
# For printing trace output for demonstration
module Status
def status( method_name, args = [], extra = nil )
extra = ' => %s' % extra if extra
puts '%s#%s(%s)%s' % [self.class, method_name, args.join(', '), extra]
end
end
@fxg42
fxg42 / optional.ex
Last active January 21, 2022 12:48
Maybe monad with an Elixir macro dsl
defmodule Optional do
defmacro __using__(_opts) do
quote do
require unquote(__MODULE__)
import unquote(__MODULE__)
end
end
def unit(nil), do: {:err, nil}
def unit(value), do: {:ok, value}
@xpepper
xpepper / Liftoff.notes.md
Last active October 10, 2024 20:43
Notes on Liftoff taken while reading "Liftoff: Launching Agile Teams & Projects"

Liftoff notes

These notes are taken while reading "Liftoff: Launching Agile Teams & Projects".

Introduction

When projects start, a liftoff generates the momentum team need to overcome the inertia presented by lack of common purpose, unclear communication channels, undefined working relationships, and other areas of ambiguity.
A liftoff also provides the positive force that moves a project toward its destination's successful delivery.

A great proportion of the issues teams wrestle with can be traced back to a lack of clarity and alignment from early days of the project: miscommunications, unexamined assumptions, and misperceptions create an environment in which people make decisions and take actions that unintentionally work at cross-purposes and undermine overall progress.

@woloski
woloski / multitenant.md
Last active February 11, 2024 23:14
Multi Tenant Apps in Auth0

Multitenancy refers to a principle in software architecture where a single instance of the software runs on a server, serving multiple client-organizations (tenants)

Let's start by enumerating some multi tenant applications and understand how they handle it.

Slack

Authentication:

@stoikerty
stoikerty / gist:40ee7d3ee6016a485092
Last active April 9, 2020 18:59
Mixin for creating Google’s “Material Design” in SCSS
// Creating Google’s “Material Design” in SCSS
// (specifically Material Shadow, uses compass)
// see: http://www.google.com/design/spec/layout/layout-principles.html#layout-principles-paper-craft
// Demo: http://codepen.io/stoikerty/full/Glwxi/
// Animating Box-Shadow is EXPENSIVE:
// http://www.html5rocks.com/en/tutorials/speed/high-performance-animations/#toc-
// Moving between z-index-depths is done via opacity & multiple
@gcarrion-gfrmedia
gcarrion-gfrmedia / 0000_packages.config
Created April 29, 2014 10:49
AWS Elastic Beanstalk Ruby 2.0/Puma Environment - .ebextensions tweaks and Sidekiq configuration. This is known to work fine with AWS Elastic Beanstalk 's 64bit Amazon Linux 2014.03 v1.0.1 running Ruby 2.0 (Puma) stack. Later stack versions might not work, but for that specific version works fine.
# Install Git needed for Git based gems
packages:
yum:
git: []