Skip to content

Instantly share code, notes, and snippets.

View bberak's full-sized avatar

Boris Berak bberak

  • Sydney, Australia
View GitHub Profile
@bberak
bberak / delete-time-machine-local-snapshots.sh
Created March 7, 2022 22:29
How to delete Time Machine local snapshots on MacOS
# List snapshots
tmutil listlocalsnapshots /
> com.apple.TimeMachine.2021-03-07-222748.local
> com.apple.TimeMachine.2022-03-07-222748.local
# Delete a snapshot
sudo tmutil deletelocalsnapshots 2022-03-07-222748
@bberak
bberak / remove-android-studio.sh
Created August 31, 2021 01:09
Remove Android Studio and its artefacts from MacOS
#!/bin/sh
# Source: https://stackoverflow.com/a/64836177/138392
# Prequisites: MacOS and Android Studio 4+ installed
# Usage: bash remove-android-studio.sh
# Deletes the Android Studio application
# Note that this may be different depending on what you named the application as, or whether you downloaded the preview version
rm -Rf /Applications/Android\ Studio.app
@bberak
bberak / gb-instructions-db.json
Last active August 12, 2021 13:34
Game Boy CPU Instruction Set Database
[
{
"mnemonic": "LD A, A",
"opCode": "7F",
"flags": {},
"bytes": 1,
"cycles": "1",
"description": "Load the contents of register A into register A."
},
{
@bberak
bberak / bin.js
Last active July 17, 2024 23:36
Write a binary buffer to file using NodeJS
const fs = require("fs");
const kb = 32 * 1024;
const buf = Buffer.alloc(kb);
const ws = fs.createWriteStream("out.bin")
buf.fill(0xEA)
ws.write(buf);
ws.end();
@bberak
bberak / react-native-windows-prequisites.ps1
Last active July 21, 2020 02:40
A modified version of the React Native Windows prequisites powershell script
# Troubleshoot RNW dependencies
param(
[switch]$Install = $false,
[switch]$NoPrompt = $false,
[switch]$Clone = $false,
[Parameter(ValueFromRemainingArguments)]
[ValidateSet('appDev', 'rnwDev', 'buildLab', 'vs2019', 'clone')]
[String[]]$Tags = @('appDev')
)
@bberak
bberak / configure-raspberry-pi.md
Last active January 27, 2024 18:07
Configure a new Raspberry PI with WiFi and SSH

Configure Raspberry PI

Setting up Image

Configuration

@bberak
bberak / aws-s3-copy-directory.sh
Last active April 3, 2020 22:59
Copy an S3 bucket (or path) to a local directory
aws s3 cp s3://bucket-name/optional-path ./local/path --recursive
@bberak
bberak / create-and-launch-ios-simulator.sh
Created February 7, 2020 01:00
Create and launch new iOS simulartor
xcrun simctl list
xcrun simctl create <Your sim name> <Device id> <Runtime id>
# Eg: xcrun simctl create XS-Max-13-3 com.apple.CoreSimulator.SimDeviceType.iPhone-XS-Max com.apple.CoreSimulator.SimRuntime.iOS-13-3
xcrun simctl boot <UUID from create command>
open -a Simulator --args -CurrentDeviceUDID <UUID from create command>
@bberak
bberak / aws-cli-s3-presign.sh
Created February 4, 2020 23:22
Presign a file in S3 for secure download using the AWS CLI
aws s3 presign s3://bucket-name/folder/file.ext [--profile your-aws-profile]
@bberak
bberak / constants.js
Created April 9, 2018 00:07
React Native Donkey Kong - Constants
module.exports = {
collisionCategories: {
mario: 1,
barrier: 2,
platform: 4,
ladder: 8,
barrel: 16
}
}