Skip to content

Instantly share code, notes, and snippets.

View vihanb's full-sized avatar
🐶
Probably at the doggo shelter

Vihan vihanb

🐶
Probably at the doggo shelter
View GitHub Profile
@vihanb
vihanb / xcasset.sh
Created April 9, 2017 02:44
Automatically generates an xcode .imageset from clipboard
#!/usr/bin/env bash
folder_path="$HOME/Downloads/$1.imageset"
mkdir -p "$folder_path"
# Determine size
SIZE=${2:-30}
N_A="${SIZE}x${SIZE}"
N_B="$((SIZE*2))x$((SIZE*2))"
N_C="$((SIZE*3))x$((SIZE*3))"
@vihanb
vihanb / dependency-resolution.md
Last active February 19, 2018 08:26
VSL Compilation Steps

Dependency Resolution

  1. Resolve functions
  2. Resolve classes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vihanb
vihanb / gitgoat.md
Last active July 7, 2018 19:16
GitGoat TODOS

GitGoat TODOs

Arranged in no specific order

  • Use HTML wiki sidebars if available
  • Proper diff viewing
  • Repository starring
  • Repository watching
  • Peek/pop support
  • Clicking on user avatars to open profile on activity feed
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQENBForclUBCAC/AqAMWSEc+8edJlAb3IuJhTGAVfzZs3Vg5L8gYoMNq9QxqWOs
d0iac/lsgwwyYEtXewmkqBFyeLeRCFv2dqQI3B+Ai4djcAg/tW1w+8rCexLM+Juo
Cp9wspQCZUoFG55+pdtbzR3SpZJBy0f3sdobqcQiM23pEK+V+OU6GNryGhx2ExaR
vr9iSDTHBqpprGvpYvbUy0aUiMrB3bUIGBjQIgMTOnBXLrgwMFhhRnnsm4eYaW5P
CPnzDWWkPMDPw5mswI/WxaCsgvhk2we1whc2rR0ustItFojvLyvPzJxib5nNDCyw
rqI8I0+3POuHuX6QaWO8h+3tocjx2g7l8D5ZABEBAAG0JFZpaGFuIEJoYXJnYXZh
IDx2aWhhbitncGdAdmloYW4ub3JnPokBVAQTAQgAPhYhBLYD74am8nF8aqQi/7O9
X4Ld0YeuBQJbjxt6AhsDBQkDwmcABQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJ
@vihanb
vihanb / pwd0.php
Last active October 21, 2018 06:18
@<?php
echo("testing");
?>
.section __TEXT,__text,regular,pure_instructions
.macosx_version_min 10, 13
.globl _main ## -- Begin function main
.p2align 4, 0x90
_main: ## @main
## %bb.0: ## %entry
pushq %rax
movl $13, %edi
callq _malloc
movw $8303, 4(%rax) ## imm = 0x206F
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vihanb
vihanb / alloc.vsl
Created January 10, 2019 03:29
VSL wasm heap allocator
private func memoryGrow(memIndex: UInt32, by size: UInt32) -> Int32 external("llvm.wasm.memory.grow.i32");
private func memorySize(memIndex: UInt32) -> UInt32 external("llvm.wasm.memory.size.i32");
// VSL WASM heap allocation implementation
// This uses a first fit technique by designing the heap
// as a linked list. This rather aggressively merges blocks
// and is kind of similar to dlalloc
// WASM Page size as designated in spec (64 Ki)
// WebAssembly Core Specification § 4.2.8
Syntax Error: Ambigous parsing (2) for:
CodeBlock
└ statements[]
└ ExpressionStatement
└ expression: BinaryExpression
├ lhs: Identifier; b
└ rhs: FunctionCall
├ head: FunctionCall
│ ├ head: Identifier; a
│ └ arguments[]