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 | |
# 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) |
import feedparser | |
import whisper | |
import sqlite3 | |
import requests | |
podcast_feed_url = "https://feeds.libsyn.com/92106/rss" | |
db_name = "podcast.db" | |
# Create the database and its tables. | |
con = sqlite3.connect(db_name) |
module Battleship | |
class Game | |
attr_accessor :player_1, :player_2 | |
def initialize(player_1, player_2) | |
@player_1 = player_1 | |
@player_2 = player_2 | |
@player_1.game = self | |
@player_2.game = self | |
end |
# tweetToSqlite.rb | |
# Drew Breunig, 2022 | |
# Use however you want. | |
# | |
# To run this script, put the 'tweets.js' file in the same directory | |
# as this script. There's one non-standard gem requirement, `sequel`. | |
# Install it with `$ gem install sequel`. Then run `ruby tweetToSqlite.rb`. | |
# | |
# TODO | |
# - Extract and save hashtag entities |