The other day we had an issue with scope when migrating from the Ruby 2 to Ruby 3 syntax for hash arguments. Previously we had something like:
def foo(**kwargs)
kwargs[:value] += 1
end
In Ruby 2 you can then do:
require 'yard' | |
# Template helper to modify processing of links in HTML generated from our | |
# markdown files. | |
module LocalLinkHelper | |
# Rewrites links to (assumed local) markdown files so they're processed as | |
# {file: } directives. | |
def resolve_links(text) | |
text = text.gsub(%r{<a href="([^"]*).md">([^<]*)</a>}, '{file:\1.html \2}') | |
super text |
The other day we had an issue with scope when migrating from the Ruby 2 to Ruby 3 syntax for hash arguments. Previously we had something like:
def foo(**kwargs)
kwargs[:value] += 1
end
In Ruby 2 you can then do:
rvm default | |
test -e {$HOME}/.iterm2_shell_integration.fish ; and source {$HOME}/.iterm2_shell_integration.fish | |
source {$HOME}/.config/fish/functions/nvm_auto_switch.fish | |
source {$HOME}/.config/fish/functions/rvm_auto_switch.fish |
# specify a directory to install | |
cask_args appdir: '/Applications' | |
brew 'openssh' | |
# unix things | |
brew 'readline' | |
brew 'tmux' | |
# services | |
brew 'mysql' |
Adding ESRI Vector Tiles to Mapbox GL JS by Jonah Adkins
Here we can see that adding an Esri vector tile service is a bit different from adding Mapbox tiles. For the Esri tiles, we’re referencing the pbf with the appropriate tiling scheme (z/x/y) using the tiles property instead of url property. To pull in each road type from Esri, I downloaded the style json and looked for references to road layers.
Appending resources/styles/root.json?f=pjson to the end of the service URL gives you the full style with layer names and such
https://tiles.arcgis.com/tiles/41TSzUbTxELRIXMD/arcgis/rest/services/2cool2school/VectorTileServer/tile/{z}/{y}/{x}.pbf
ogr2ogr -f 'PostgreSQL' PG:"dbname=ctnj-vote_development user=mzagaja" housect_37800_0000_2010_s100_census_1_shp_wgs84.shp -nlt MULTIPOLYGON -nln ct_house_districts
system({dbname: Rails.configuration.database_configuration[Rails.env]['database']}, "ruby", "-e p ENV['rubyguides']")
There is a Google Ruby client for doing this. They also have documentation.
# Matt Zagaja Rails Template | |
gem_group :development, :test do | |
gem 'dotenv-rails' | |
gem 'factory_bot_rails' | |
gem 'pry-byebug' | |
gem 'rspec-rails' | |
end | |
gem_group :development do | |
gem 'capistrano', '~> 3.10', require: false |
#! /usr/bin/fish | |
curl -sSL https://get.rvm.io | bash -s stable | |
curl -L --create-dirs -o ~/.config/fish/functions/rvm.fish https://raw.github.com/lunks/fish-nuggets/master/functions/rvm.fish | |
echo "rvm default" >> ~/.config/fish/config.fish | |
# brew install python@2 python | |
pip install virtualfish | |
'eval (python -m virtualfish)' >> ~/.config/fish/config.fish |