title | description | author | created | updated | ||
---|---|---|---|---|---|---|
{{title}} |
{{description}} |
{{author}} |
|
|
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
# | |
# Copyright (c) nexB Inc. and others. All rights reserved. | |
# SPDX-License-Identifier: Apache-2.0 | |
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text. | |
# See https://aboutcode.org for more information about nexB OSS projects. | |
# | |
from traceback import format_exc as traceback_format_exc | |
import requests |
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
class SolidQueueAliveServer | |
def initialize(host: nil, port: nil, engine: nil, logger: nil) | |
@host = host || "0.0.0.0" | |
@port = port || 7433 | |
@engine = engine || "puma" | |
@logger = logger || Rails.logger | |
end | |
def run! | |
require "rackup" |
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
function current_dir() { | |
local current_dir=$PWD | |
if [[ $current_dir == $HOME ]]; then | |
current_dir="~" | |
else | |
current_dir=${current_dir##*/} | |
fi | |
echo $current_dir | |
} |
In programming languages, literals are textual representations of values in the source code. This is a syntactical concept.
Some examples:
7 # integer literal
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
if ENV["DEBUG_CALLBACKS"] | |
Rails.application.eager_load! | |
ActiveRecord::Callbacks::CALLBACKS.each do |callback_type| | |
ApplicationRecord.descendants.each do |model| | |
kind, name = callback_type.to_s.split("_") | |
chain = model.__callbacks[name.to_sym]&.send(:chain) | |
filtered = chain&.select { |chain_callback| chain_callback.kind == kind.to_sym } | |
$callbacks_counter ||= {} | |
$callbacks_counter[model.name] ||= {} |
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
# NOTE: partial content required for Gemfile | |
gem "rails" | |
gem "propshaft" | |
gem "importmap-rails" | |
gem "stimulus-rails" | |
gem "tailwindcss-rails" | |
gem "action_policy" |
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
# THIS LINUX SETUP SCRIPT HAS MORPHED INTO A WHOLE PROJECT: HTTPS://OMAKUB.ORG | |
# PLEASE CHECKOUT THAT PROJECT INSTEAD OF THIS OUTDATED SETUP SCRIPT. | |
# | |
# | |
# Libraries and infrastructure | |
sudo apt update -y | |
sudo apt install -y \ | |
docker.io docker-buildx \ | |
build-essential pkg-config autoconf bison rustc cargo clang \ |
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
#!/usr/bin/env bash | |
# ~/.ssh/gcp-start-iap-tunnel-ssh-proxy-magic.sh | |
# a script to be used as SSH ProxyCommand to allow fully functional SSH access to any Google Cloud Compute Engine VMs allowing IAP access | |
# | |
# Author: Jaeho Shin <[email protected]> | |
# Created: 2022-10-31 | |
# See also: | |
# - https://gist.github.com/netj/df4f9de1fefd254ab11979be7035b5d0/#readme | |
# - https://cloud.google.com/iap/docs/using-tcp-forwarding | |
# |
I get asked pretty regularly what my opinion is on merge commits vs rebasing vs squashing. I've typed up this response so many times that I've decided to just put it in a gist so I can reference it whenever it comes up again.
I use merge, squash, rebase all situationally. I believe they all have their merits but their usage depends on the context. I think anyone who says any particular strategy is the right answer 100% of the time is wrong, but I think there is considerable acceptable leeway in when you use each. What follows is my personal and professional opinion:
NewerOlder