Skip to content

Instantly share code, notes, and snippets.

View hyperandroid's full-sized avatar
💭
Fun at PlatoApp

Ibon Tolosana hyperandroid

💭
Fun at PlatoApp
View GitHub Profile
# Install git:
sudo apt install git
# Install depot tools
Follow instructions https://v8.dev/docs/source-code.
# Fetch v8 source code.
# Use the branch of your choice. In will use 8.4-lkgr (last known good release).
# I'd advise always using -lkgr branches
fetch v8
@hyperandroid
hyperandroid / gist:52f8198347d61c3fa62c75c72c31deb6
Created September 16, 2018 13:16
JavascriptCore ArrayBuffer from Data
// allocate a pointer to hold contents
let ptr: UnsafeMutableBufferPointer<UInt8> = UnsafeMutableBufferPointer<UInt8>.allocate(capacity: contents!.count)
// copy Data into ptr
contents?.withUnsafeBytes { (contentsPtr: UnsafePointer<UInt8>) -> Void in
let _ = ptr.initialize(from: UnsafeBufferPointer(start: contentsPtr, count: contents!.count))
}
var exception : JSValueRef?
let deallocator: JSTypedArrayBytesDeallocator = { ptr, deallocatorContext in
alias glog='git log --graph --pretty="format:%C(yellow)%h%Cred%d%Creset %s %C(white) %C(cyan)%an%Creset, %C(green)%ar%Creset"'