- Configure git.
# ~/.config/git/config
[sendemail]
confirm = auto
smtpServer = smtp.gmail.com
smtpServerPort = 587
smtpEncryption = tls
smtpUser = <gmail email address>
# ~/.config/git/config
[sendemail]
confirm = auto
smtpServer = smtp.gmail.com
smtpServerPort = 587
smtpEncryption = tls
smtpUser = <gmail email address>
class BitInquirer | |
def self.[](mask_map) | |
Class.new(SimpleDelegator) do | |
mask_map.each do |name, mask| | |
define_method name do | |
allbits?(mask) | |
end | |
end | |
end | |
end |
module MailerPreviewHelper | |
extend ActiveSupport::Concern | |
included do | |
# Allows a mailer preview to override `params` method (either class or instance level) | |
# to define the hash that will be passed to the mailer by default by the `preview` helper. | |
class_attribute :params, default: {}, instance_accessor: false | |
mailer.instance_methods(false).each do |action| | |
define_method(action) { mailer.with(**params).send action } |
$ grep -RIho -E '\$npm_package_[_0-9a-z]*' . 2>/dev/null | sort -u | |
$npm_package_ | |
$npm_package_actions | |
$npm_package_bin_brew_publish | |
$npm_package_bin_node_build | |
$npm_package_bin_packfiles | |
$npm_package_bin_validate_analytics_data | |
$npm_package_browser | |
$npm_package_config_ | |
$npm_package_config_app |
Because nodenv was forked from rbenv, many of the reasons to choose nodenv over others are similar to why one would choose rbenv over rvm. (Nodenv also inherits a much longer battle-tested history than others.)
One of the biggest reasons to choose nodenv over the others is that nodenv can automatically select the appropriate node version for a given project. Neither nvm nor n have auto-switching capabilities out of the box. They both require some form of 'use' command to activate a given version; which lasts for the lifetime of the shell (or until another version is activated).
[ "$NODENV_COMMAND" = npx ] || return 0 | |
remove_from_path() { | |
local path_to_remove="$1" | |
local path_before | |
local result=":${PATH//\~/$HOME}:" | |
while [ "$path_before" != "$result" ]; do | |
path_before="$result" | |
result="${result//:$path_to_remove:/:}" | |
done |
module.exports = function findMaxValidDate(min, max) { | |
var next = Math.floor((min+max)/2); | |
if(min == next) return min; | |
if(new Date(next) == "Invalid Date") { | |
return findMaxValidDate(min, next); | |
} else { | |
return findMaxValidDate(next, max); | |
} |
require 'axe/configuration' | |
module Axe | |
class FindsPage | |
WEBDRIVER_NAMES = [ :page, :browser, :driver, :webdriver ] | |
class << self | |
alias :in :new | |
end |
require 'singleton' | |
class Configuration | |
include Singleton | |
def init_with(attributes) | |
attributes.map.each do |k,v| | |
self.class.instance.instance_variable_set(:"@#{k}", v) | |
end | |
end |