This SCAD script allows you to print mulitple numbered coin tokens meant to be drawn at random from a bag. There are lines over the top of the number to make it more difficult to feel around for a specific number. To change the number, modify the last line of code to include the desired number. Then take the code to https://ochafik.com/openscad2/ and download it as STL, then slice it with your favorite slicer. It should be able to be printed at any size required, without needing any supports.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Based on 'distance-from' NPM package: https://github.com/rickyplouis/distance-from | |
* refactored to: | |
* - make the Distance object immutable | |
* - remove superfluous distance options | |
* - make types more succinct | |
* - improve amount of validation for positions | |
*/ | |
export type Position = [latitude: number, longitude: number]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { readFileSync, writeFileSync } from "fs"; | |
import glob from "glob"; | |
import { pascalCase } from "change-case"; | |
const defaultExportPattern = /export default \{/; | |
glob.sync("lib/**/index.js").forEach((file) => { | |
const fileContents = readFileSync(file, "utf-8").toString(); | |
if (!defaultExportPattern.test(fileContents)) { | |
return; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$thickness = 2; | |
$outerDiameter = 20; | |
$innerDiameter = $outerDiameter - 2 * $thickness; | |
$center = true; | |
module coin($text) { | |
difference() { | |
cylinder($thickness, d=$outerDiameter, center=$center); | |
cylinder($thickness, d=$outerDiameter - $thickness, center=$center); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// workaround script to keep TypeScript from crashing in VSCode | |
// since Pulumi has too big of a package | |
// run this script after installing NPM packages for infrastructure | |
// originally created by Ankvi: | |
// https://github.com/pulumi/pulumi-azure-native/issues/1997#issuecomment-1370835665 | |
import { readdir, rm, writeFile, readFile } from "fs/promises"; | |
import { join } from 'path'; | |
const rootFolder = join(__dirname,'../node_modules/@pulumi/azure-native'); | |
const enumsFolder = join(rootFolder,'types/enums'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ umask 000 | |
+ GIT_LFS_SKIP_SMUDGE=1 retry 6 git clone --branch="main" --depth 50 https://x-token-auth:[email protected]/$BITBUCKET_REPO_FULL_NAME.git $BUILD_DIR | |
Cloning into '/opt/atlassian/pipelines/agent/build'... | |
+ git reset --hard 4c684f2c6785329c62e18489ded3dbaf3f76ac0f | |
HEAD is now at 4c684f2 fix syntax error | |
+ git config user.name bitbucket-pipelines |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🕊️ 🖼️ 🍇 | |
🖍️🆕isMatch👌 | |
🖍️🆕matchPosition🍬🔢 | |
🖍️🆕matchLength🍬🔢 | |
🆕 🍼isMatch👌 🍼matchPosition🍬🔢 🍼matchLength🍬🔢 🍇🍉 | |
🆕▶️📙 🍇 | |
👎 ➡️ 🖍️isMatch | |
🤷 ➡️ 🖍️matchPosition | |
🤷 ➡️ 🖍️matchLength |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var apples = new[] { new Apple("Red"), new Apple("Blue"), new Apple("Green") }; | |
var oranges = new[] { new Orange(Size.Large), new Orange(Size.Small), new Orange(Size.Medium) }; | |
// works | |
Console.WriteLine(string.Join(',', apples.OrderBy(x => x))); | |
// throws InvalidOperationException | |
Console.WriteLine(string.Join(',', oranges.OrderBy(x => x))); | |
class Apple : IComparable<Apple> |
NewerOlder