Skip to content

Instantly share code, notes, and snippets.

View sponomarev's full-sized avatar
🔴
Offline

Sergey Ponomarev sponomarev

🔴
Offline
View GitHub Profile
@shioyama
shioyama / webpacker_sync.rake
Last active June 24, 2020 13:34
Sync files from Rails webpacker manifest.json to S3 asset bucket.
# Sync files from webpacker manifest.json to S3 asset bucket.
# Based on asset_sync but much simplified for this case.
#
# Requirements
#
# Add fog to Gemfile.
#
# Environment variables:
# - AWS_S3_ASSETS_BUCKET_NAME
# - AWS_S3_REGION
@enricofoltran
enricofoltran / main.go
Last active April 1, 2024 00:17
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
# decompress gzip-ed VCR fixtures
require 'zlib'
require 'psych'
Dir.glob('spec/fixtures/vcr_cassettes/**/*.yml').each do |filename|
data = Psych.load_file(filename)
changed = false
data['http_interactions'].each do |interaction|
@maelvls
maelvls / How-to-automate-build-bottles-your-homebrew-tap.md
Last active October 31, 2023 03:33
Automate build workflow for Homebrew tap bottles (Linux and macOS)

How to automate the build of bottles on your Homebrew tap

Note on Oct 4, 2018: due to a change in Homebrew's brew test-bot behaviour, the user must set HOMEBREW_TRAVIS_CI and HOMEBREW_TRAVIS_SUDO appropriately (it was previously using Travis-CI-provided TRAVIS and TRAVIS_SUDO).

This tutorial is a follow-up to the discussion we had on davidchall/homebrew-hep#114. It relies on a fork of the test-bot provided by davidchall; you can get it with brew tap maelvalais/test-bot. First:

  1. the Github project must be of the form https://github.com//homebrew- with the following tree
@romashamin
romashamin / Do Not Disturb for 10 min.scpt
Last active June 16, 2017 12:16
Enables ‘Do Not Disturb’ for 10 min
my setDoNotDisturbON()
say "Do not disturb is on now" using "Samantha"
delay 600
my setDoNotDisturbOFF()
say "Do not disturb is off. Welcome to hell!" using "Samantha"
@learner-long-life
learner-long-life / Rinkeby.md
Last active August 30, 2022 22:32
How to get on Rinkeby Testnet in less than 10 minutes

How to get on Rinkeby Testnet in less than 10 minutes

Following instructions from the excellent https://www.rinkeby.io/

Synchronizing a Full Node

A full node lets you access all state. There is a light node (state-on-demand) and wallet-only (no state) instructions as well,

@wvengen
wvengen / README.md
Last active March 25, 2024 07:53
Ruby memory analysis over time

Finding a Ruby memory leak using a time analysis

When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.

There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the

@joyrexus
joyrexus / README.md
Created February 21, 2015 14:21
Functional config in go

Quick demo of how to initialize your data structure with optional configuration parameters ... with sane defaults if left unspecified.

This functional config technique ...

  • lets you write APIs that can evolve without pain
  • provides meaningful configuration parameters
  • makes it easy to set default settings
  • makes it possible to set complex conditional values
@JunichiIto
JunichiIto / alias_matchers.md
Last active April 16, 2024 16:18
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)