View deploy_to_cloudfront.yaml
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
on: | |
push: | |
branches: | |
- master | |
name: Git Tag | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
check_version: | |
name: Check Version |
View intrumentation.rb
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 Instrumentation | |
DEFAULT_OPERATION = 'method.execution' | |
def self.trace(operation: DEFAULT_OPERATION, resource:, **options) | |
options.merge!(resource: resource).compact! | |
Datadog.tracer.trace(operation, options) do |span| | |
Datadog::Analytics.set_measured(span) | |
yield | |
end | |
rescue StandardError |
View fun.css
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)); | |
} |
View step_function.rb
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
def step(min: 1, comp: 20) | |
return 0 if min == comp | |
(1 - (min - comp).abs / (min - comp).to_f) / 2 | |
end |
View actions.yaml
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 |
View useViewportSize.js
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 () => { |
View esbuild.build.js
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()], |
View t9.rb
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 |
View wrapper.rb
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 |
View .env
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 |
NewerOlder