I hereby claim:
- I am byronbowerman on github.
- I am bm5k (https://keybase.io/bm5k) on keybase.
- I have a public key ASDEciwhabrTBtffdF3QwZES9vwd6ccEkFNADrCJMk3LTwo
To claim this, I am signing this object:
# Return JSON exceptions instead of rails' html exceptions | |
# | |
# example: | |
# | |
# When `params.require(:foo)` is called without a `:foo` parameter | |
# | |
# response body: | |
# { | |
# "exception": "ActionController::ParameterMissing", | |
# "message": "param is missing or the value is empty: foo" |
def delegate_to_response? name, public_only=false | |
response.respond_to?(name, public_only) | |
end | |
def respond_to_missing? name, public_only=false | |
delegate_to_response?(name, public_only) || super | |
end |
require 'active_support/core_ext/string/inflections' | |
class Foo | |
def initialize *args | |
puts args.inspect | |
end | |
end | |
class Bar | |
end |
sudo nano /etc/apt/sources.list.d/vscode.list | |
sudo rm /etc/apt/trusted.gpg.d/microsoft.gpg | |
sudo touch /etc/apt/trusted.gpg.d/microsoft.gpg | |
sudo chattr +i /etc/apt/trusted.gpg.d/microsoft.gpg | |
sudo chattr +i /etc/apt/sources.list.d/vscode.list |
2.5.8 :001 > class String | |
2.5.8 :002?> def and(other) | |
2.5.8 :003?> "#{ self } AND #{ other }" | |
2.5.8 :004?> end | |
2.5.8 :005?> end | |
=> :and | |
2.5.8 :006 > "foo".and "bar" | |
=> "foo AND bar" | |
2.5.8 :007 > "foo" & "bar" | |
Traceback (most recent call last): |
curl --request PUT \ | |
--header 'Content-Type: application/json;charset=UTF-8' \ | |
--header "PRIVATE-TOKEN: $GITLAB_TOKEN" \ | |
--data-binary '{"container_expiration_policy_attributes":{"cadence":"1day","enabled":false,"keep_n":10,"older_than":"90d","name_regex":":(?!v(\d+\.){2}\d+)"}' \ | |
https://gitlab.example.com/api/v4/projects/2' | |
# Usage: | |
# | |
# class MyClass | |
# feature :my_feature | |
# end | |
# | |
# Defines the following instance method in MyClass: | |
# | |
# def my_feature *args | |
# if Feature.active?(:my_class_my_feature) |
I hereby claim:
To claim this, I am signing this object:
require 'securerandom' | |
module MyNamespace | |
class ContrivedExample < ApplicationRecord | |
MINIMUM_DESIRED = 3 | |
extend Forwardable | |
include MyNamespace::Shared |