Skip to content

Instantly share code, notes, and snippets.

Avatar

Tanmay Bakshi tanmayb123

  • Software Developer, YouTuber
  • Canada
View GitHub Profile
View AppleSiliconMinecraft_v2.md

Minecraft on Apple Silicon (v2 - 1.17 & Microsoft authentication)

In this gist, you can find the steps to run Minecraft 1.17 natively on Apple Silicon (AS), without needing Rosetta 2 translation of the dependencies (mainly LWJGL and related libraries).

While it's possible to use a launcher like MultiMC to have a prettier way to run the game on AS, it requires installing even more dependencies (like QT) which take time and are difficult to distribute. Therefore, I've put together a command line-based launcher tool using a couple shell & Python scripts.

To get up and running quickly, follow the steps below. Otherwise, for more detail, watch my YouTube videos: old, new.

Download my package

View Sudoku.swift
import Foundation
struct SudokuBoard {
var board: [Int]
subscript(_ x: Int, _ y: Int) -> Int {
get {
return board[y * 9 + x]
}
set {
View AppleSiliconMinecraft.md

Minecraft on Apple Silicon

In this gist, you can find the steps to run Minecraft 1.16.4 natively on Apple Silicon (AS), without needing Rosetta 2 translation of the dependencies (mainly LWJGL and related libraries).

While it's possible to use a launcher like MultiMC to have a prettier way to run the game on AS, it requires installing even more dependencies (like QT) which take time and are difficult to distribute. Therefore, I've put together a command line-based launcher tool using a couple shell & Python scripts.

To get up and running quickly, follow the steps below. Otherwise, for more detail, watch my YouTube video.

Download my package

View Fast2048.swift
import Foundation
struct FastRandomGenerator {
static var shared = FastRandomGenerator()
private var seed: UInt32
init() {
seed = UInt32.random(in: 1...500000000)
}
View Trilateration.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View mysqld.callgraph
This file has been truncated, but you can view the full file.
"Balloc" -> "llvm.dbg.value"
"Balloc" -> "malloc"
"FTB_WORD_cmp" -> "llvm.dbg.value"
"FTB_WORD_cmp.37624" -> "llvm.dbg.value"
"FTB_WORD_cmp_list" -> "llvm.dbg.value"
"FTB_WORD_cmp_list.37625" -> "llvm.dbg.value"
"FT_DOC_cmp" -> "llvm.dbg.value"
"FT_DOC_cmp.37650" -> "llvm.dbg.value"
"FT_STOPWORD_cmp" -> "llvm.dbg.value"
View cpython.callgraph
This file has been truncated, but you can view the full file.
"BaseException_clear" -> "_Py_Dealloc"
"BaseException_clear" -> "llvm.dbg.value"
"BaseException_dealloc" -> ""
"BaseException_dealloc" -> "BaseException_clear"
"BaseException_dealloc" -> "llvm.dbg.value"
"BaseException_get_args" -> "llvm.dbg.value"
"BaseException_get_cause" -> "llvm.dbg.value"
"BaseException_get_context" -> "llvm.dbg.value"
"BaseException_get_tb" -> "llvm.dbg.value"
View lz4callgraph
"BMK_benchCLevel" -> ""
"BMK_benchCLevel" -> "LZ4_XXH64"
"BMK_benchCLevel" -> "LZ4_compressBound"
"BMK_benchCLevel" -> "LZ4_decompress_safe"
"BMK_benchCLevel" -> "RDG_genBuffer"
"BMK_benchCLevel" -> "__assert_fail"
"BMK_benchCLevel" -> "clock_gettime"
"BMK_benchCLevel" -> "exit"
"BMK_benchCLevel" -> "fprintf"
"BMK_benchCLevel" -> "fputc"
View test.ll
; ModuleID = '/tmp/webcompile/_8542_0.bc'
source_filename = "/tmp/webcompile/_8542_0.cc"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-ellcc-linux"
; Function Attrs: noinline nounwind optnone
define i32 @_Z5toIntf(float) #0 {
%2 = alloca float, align 4
store float %0, float* %2, align 4
%3 = load float, float* %2, align 4
View t2048.swift
import Foundation
extension String {
func paddedZeros(length: Int) -> String {
if count == length {
return self
}
return ([Character](repeating: "0", count: length - count) + Array(self)).map({ String($0) }).joined()
}
}