In Powershell:
$ ipconfig
Note the name of your network connector. Then:
$ netsh int ipv4 set interface "Wi-Fi" forwarding=enable
Replacing "Wi-Fi" with the name of your connector.
zcat ../latest-all.json.gz | sed 's/,$//' | split -l 100000 - wd_items_cw --filter='gzip > $FILE.gz' |
EMOJI_CODEPOINTS = [ | |
*0x1F600..0x1F64F, # Emoticons | |
*0x1F300..0x1F5FF, # Misc Symbols and Pictographs | |
*0x1F680..0x1F6FF, # Transport and Map Symbols | |
*0x2600..0x26FF, # Misc symbols | |
*0x2700..0x27BF, # Dingbats | |
*0x1F900..0x1F9FF, # Supplemental Symbols and Pictographs | |
*0x1FA70..0x1FAFF # Symbols and Pictographs Extended-A | |
] | |
def random_emoji = EMOJI_CODEPOINTS.sample.chr(Encoding::UTF_8) |
def process_file(filename) | |
puts "Processing file: #{filename}" | |
File.open(filename) do |filename| | |
# Do stuff | |
end | |
end | |
puts "Done processing file: #{filename}" | |
end | |
# Define the number of Ractors in the pool |
#!/bin/bash | |
# Usage | |
# ./places_for_desciption.sh 'DESCRIBE THE LOCATION YOU WANT PLACES FOR' | |
# Check if an argument is provided | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $0 'Location Name'" | |
exit 1 | |
fi |
In Powershell:
$ ipconfig
Note the name of your network connector. Then:
$ netsh int ipv4 set interface "Wi-Fi" forwarding=enable
Replacing "Wi-Fi" with the name of your connector.
#!/bin/bash | |
# Create a folder called data | |
mkdir -p data | |
# Find the most recent parquet directory with the theme 'places' | |
recent_dir=$(aws s3 ls s3://overturemaps-us-west-2/release/ --recursive | grep "theme=places" | sort | tail -n 1 | awk -F '/' '{print $1"/"$2"/"$3"/"$4}') | |
# Extract the release date from the directory path | |
release_date=$(echo $recent_dir | awk -F '/' '{print $2}') |
There's plenty of documentation out there describing how to create a polymorphic association in Rails and Active Record. But not much about updating an existing association.
Say you have the following model:
class Post < ApplicationRecord
belongs_to :user
end
First, create a new Stimulus controller. Here, we've title it time_zone_setter_controller.js
. This controller does one thing: when the controller connects, it updates the value of the field
target to the browser's reported time zone.
It reads:
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
import click | |
import duckdb | |
import sqlite_utils | |
# Set up click | |
@click.command() | |
@click.option("--minx", default=-122.347183) | |
@click.option("--maxx", default=-122.218437) | |
@click.option("--miny", default=37.748729) | |
@click.option("--maxy", default=37.800290) |