- Install Docker for Mac
- https://store.docker.com/editions/community/docker-ce-desktop-mac
- once installed enable kubernetes from preferences and select kubernetes as the default orchestrator
- on the advanced section, increase your cpu and memory to about 2 CPU and 2gb of RAM, for now.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.highlight { | |
border-radius: 1em 0 1em 0; | |
background-image: linear-gradient(-100deg, rgba(255,224,0,0.3), rgba(255,224,0,0.7) 95%, rgba(255,224,0,0.1)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Close stale issues and PR' | |
on: | |
schedule: | |
- cron: '30 1 * * *' | |
jobs: | |
stale: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/stale@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { build } = require('esbuild'); | |
const manifestPlugin = require('esbuild-plugin-manifest'); | |
const options = { | |
entryPoints: ['src/index.js'], | |
entryNames: '[dir]/[name]-[hash]', | |
outdir: 'dist', | |
bundle: true, | |
minify: true, | |
plugins: [manifestPlugin()], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState, useLayoutEffect } from "react"; | |
export const useViewportSize = (debounceTime = 250) => { | |
const [viewportSize, setViewportSize] = useState({ | |
width: undefined, | |
height: undefined | |
}); | |
const debounce = (fn, ms) => { | |
let timer; | |
return () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'set' | |
module Trie | |
class T9 | |
attr_reader :root | |
def initialize | |
@root = Hash.new | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pundit | |
# Friendly ID | |
# FastJSON | |
module ActsAsResource | |
extend ActiveSupport::Concern | |
included do | |
include Pundit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Wrapper | |
def wrap(method_name, options: {}) | |
proxy = Module.new | |
proxy.define_method(method_name) do |*args, &block| | |
options = instance_exec(&options) if options.is_a?(Proc) | |
target = is_a?(Module) ? "#{self}." : "#{self.class}#" | |
puts "#{target}#{method_name} is about to be called. `wrap` options #{options}" | |
super *args, &block | |
end | |
self.prepend proxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/bkeepers/dotenv | |
COMPOSE_PROJECT_NAME=my_app | |
REDIS_URL=redis://redis:6379 | |
PGHOST=db | |
PGUSER=postgres | |
PGPASSWORD=postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec.describe Api::ClientBase do | |
subject(:api) { described_class.new(config) } | |
let(:scheme) { 'https' } | |
let(:host) { Faker::Internet.domain_name } | |
let(:port) { 3000 } | |
let(:config) do | |
{ | |
'scheme' => scheme, |