- A = [xA, yA] is a point on the 2D plane. Same for B, C, ...
- lengths are in any unit (ex: pixels)
- code snippets are in JavaScript
angleRad = angleDeg * Math.PI / 180;
| import SwiftUI | |
| extension Text { | |
| public struct InlineSymbol { | |
| public let name: String | |
| public let accessibilityLabel: String | |
| public let color: Color? | |
| public init(name: String, accessibilityLabel: String, color: Color? = nil) { | |
| self.name = name |
| #!/bin/bash | |
| # | |
| # This script will browse a Slack export folder and download all files in a new /export folder | |
| # | |
| # HOW TO: | |
| # 1. As a Workspace admin, download an export of your Slack history (https://www.slack.com/services/export) | |
| # 2. Make sure you have jq installed (https://stedolan.github.io/jq/) | |
| # 3. Place this file at the root of your Slack export folder, next to channels.json | |
| # 4. Run `bash slack-files-downloader.sh` in your terminal | |
| # |
| #!/usr/bin/python | |
| import argparse | |
| import json | |
| import os | |
| import sys | |
| from typing import List, Optional | |
| from urllib.request import urlopen | |
| """Downloads all files of messages of your Slack (workspace) JSON export. Each channel |
| /** | |
| * I needed a property wrapper that fulfilled the following four requirements: | |
| * | |
| * 1. Values are stored in UserDefaults. | |
| * 2. Properties using the property wrapper can be used with SwiftUI. | |
| * 3. The property wrapper exposes a Publisher to be used with Combine. | |
| * 4. The publisher is only called when the value is updated and not | |
| * when_any_ value stored in UserDefaults is updated. | |
| * | |
| * First I tried using SwiftUI's builtin @AppStorage property wrapper |
| import datetime | |
| import json | |
| import os | |
| import subprocess | |
| import sys | |
| ############# | |
| ### USAGE ### | |
| ############# |
| // | |
| // Author: Jonathan Blow | |
| // Version: 1 | |
| // Date: 31 August, 2018 | |
| // | |
| // This code is released under the MIT license, which you can find at | |
| // | |
| // https://opensource.org/licenses/MIT | |
| // | |
| // |
| package main | |
| import ( | |
| "context" | |
| "flag" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| "os/signal" |
| // Mini memory editor for Dear ImGui (to embed in your game/tools) | |
| // Animated GIF: https://twitter.com/ocornut/status/894242704317530112 | |
| // THE MEMORY EDITOR CODE HAS MOVED TO GIT: | |
| // https://github.com/ocornut/imgui_club/tree/master/imgui_memory_editor | |
| // Click "Revisions" on the Gist to see old version. |
| # The MIT License (MIT) | |
| # Copyright (c) 2016 Vladimir Ignatev | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining | |
| # a copy of this software and associated documentation files (the "Software"), | |
| # to deal in the Software without restriction, including without limitation | |
| # the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
| # and/or sell copies of the Software, and to permit persons to whom the Software | |
| # is furnished to do so, subject to the following conditions: | |
| # |