Skip to content

Instantly share code, notes, and snippets.

@manila
manila / prompt.sh
Created August 5, 2023 16:24
Source into bash profile for a better prompt for piper | fig | git workspaces
print_relative_dir() {
re="^$HOME(/?.*)"
[[ "$PWD" =~ $re ]] && echo "~${BASH_REMATCH[1]}" || echo "$PWD"
}
is_workspace() {
# Path on macOS will begin with /Volumes
re="^(/Volumes)?(/google/src/cloud)/(${USER})/([^/]+)(/.*)?"
dir="$PWD"
[[ "$dir" =~ $re ]] && return 0 || return 1
@manila
manila / cracklepop.js
Last active August 31, 2021 22:07
cracklepop
const cracklePop = (start, end, step = 1) => {
let num = start
if (num > end) {
return false
}
let result = num
@manila
manila / invaders.html
Last active April 27, 2019 05:40
Space invaders in JavaScript
<!--
Space Invaders without the ability to shoot
by Manuel Nila April 2019
live version https://manila.me/invaders
-->
<html lang="en">
<head>
<style type="text/css">
body {

Keybase proof

I hereby claim:

  • I am manila on github.
  • I am manila (https://keybase.io/manila) on keybase.
  • I have a public key whose fingerprint is 0995 EE17 1B7D B18C BC88 2BFF 29AD 8EE1 D724 4FFD

To claim this, I am signing this object: