Skip to content

Instantly share code, notes, and snippets.

View donaldducky's full-sized avatar
🎄
It's the time of year for Advent of Code!

Don Chea donaldducky

🎄
It's the time of year for Advent of Code!
View GitHub Profile
@donaldducky
donaldducky / get_title_and_url.applescript
Last active March 1, 2021 13:45 — forked from dongyuwei/get_title_and_url.applescript
Applescript to get frontmost tab’s url and title of various browsers.
# Keep in mind that when asking for a `return` after another, only the first one will be output.
# This example is meant as a simple starting point, to show how to get the information in the simplest available way.
# Google Chrome
tell application "Google Chrome" to return URL of active tab of front window
tell application "Google Chrome" to return title of active tab of front window
tell application "Google Chrome" to return {title, URL} of active tab of front window
# Google Chrome Canary
tell application "Google Chrome Canary" to return URL of active tab of front window
@donaldducky
donaldducky / field_of_view.rs
Created August 9, 2020 01:45 — forked from sbowman/field_of_view.rs
Replacement for Rust rltk::field_of_view
use super::Map;
use super::rltk::{BaseMap, Point};
// Transform represents a sector to shadow cast.
struct Transform {
xx: i32,
xy: i32,
yx: i32,
yy: i32,
}