This file contains hidden or 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
| #!/bin/bash | |
| # Author: Andrew Brampton (bramp.net) | |
| # Link: https://gist.github.com/bramp/ca45fe6b64fbc7ff398022dbc2e35eb7 | |
| # safe_cleanup.sh - Reclaims disk space by clearing files older than 30 days. | |
| DAYS=30 | |
| show_space() { | |
| echo "Filesystem Size Used Avail Capacity Mounted on" | |
| df -h / /System/Volumes/Data | tail -n +2 |
This file contains hidden or 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
| # My Mac Setup | |
| # Using a lot of notes from https://www.robinwieruch.de/mac-setup-web-development/ | |
| # Enable intel2arm silcon | |
| sudo softwareupdate --install-rosetta --agree-to-license | |
| # Install brew | |
| /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
| # Install brew packages |
This file contains hidden or 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
| # A program that fetches past winning numbers and draw results from www.calottery.com | |
| # # Setup | |
| # python3 -m venv .venv | |
| # source .venv/bin/activate | |
| # (venv) $ python -m pip install requests requests_cache dotted-notation | |
| # | |
| # # Run | |
| # python fetch.py | |
| # |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| # Creates a model of a 3D Hilbert curve, suitable for 3D printing. | |
| # by Andrew Brampton (bramp.net) 2023 | |
| # See https://www.printables.com/model/518431 | |
| # | |
| # Usage: | |
| # python3 make.py 4 4 4 --voxelizer voxelmap --spacing 3 | |
| # python3 make.py 4 4 4 --voxelizer trimesh --spacing 2 | |
| # |
This file contains hidden or 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
| digraph "401k" { | |
| label = "Assumptions - 2018 - Age < 50 - Single - Income > $135k - 50% company match of 401(k)\n"; | |
| "Pay Cheque (Pre-tax)" -> "Pre-tax 401(k)" [ label = "Max $18.5k*" ]; | |
| "Pay Cheque (After-tax)" -> "Roth 401(k)" [ label = "Max $18.5k*" ]; | |
| "Pay Cheque (After-tax)" -> "After-tax 401(k)" [ label = "Max $27.25k" ]; | |
| "Pay Cheque (After-tax)" -> "Bank Account (After-tax)"; |
This file contains hidden or 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
| /** | |
| * Copyright 2017 Google Inc. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * https://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
This file contains hidden or 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
| /* | |
| Copyright 2017 Google Inc. | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| https://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, software |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # Prints a list of all owned repositories with pages. | |
| # by Andrew Brampton 2016 https://bramp.net | |
| # | |
| # Copyright 2016 Google Inc. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # |
This file contains hidden or 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
| Benchmark Mode Cnt Score Error Units | |
| UnrolledCopierBenchmark.ByteLoopState.test thrpt 25 32035617.621 ± 203057.890 ops/s | |
| UnrolledCopierBenchmark.ForLoopState.test thrpt 25 137210309.246 ± 3297133.141 ops/s * For loop | |
| UnrolledCopierBenchmark.LoopState.test thrpt 25 148544358.728 ± 10786777.032 ops/s * While loop | |
| UnrolledCopierBenchmark.HandUnrolledState.test thrpt 25 447763590.583 ± 7256308.885 ops/s | |
| UnrolledCopierBenchmark.UnrolledState.test thrpt 25 455870292.662 ± 4004173.595 ops/s | |
| (Larger scores the better) | |
| https://github.com/bramp/unsafe/blob/master/unsafe-unroller/src/main/java/net/bramp/unsafe/LoopingForUnsafeCopier.java#L36 | |
| https://github.com/bramp/unsafe/blob/master/unsafe-unroller/src/main/java/net/bramp/unsafe/LoopingUnsafeCopier.java#L38 |
This file contains hidden or 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
| #!/bin/sh | |
| # Finds fake files (e.g. those files which are 700mb big, but contain just zeros) | |
| # by bramp.net 2015 | |
| # | |
| if [ -z "$1" ]; then | |
| echo "Usage: $0 <directory/files>" | |
| echo "List files that are fakes" | |
| return | |
| fi | |
| for path in "$@" |
NewerOlder