Skip to content

Instantly share code, notes, and snippets.

Secretly a squirrel

Bas Mechazawa

Secretly a squirrel
View GitHub Profile
View lazyMap.js
// Example:
function lazyArray(data, func) {
const out = [];
for (let i = 0; i < data.length; i++) {
function set(value) {
delete out[i];
return out[i] = value;
Mechazawa /
Created Jun 27, 2017
cd back to project directory
function cdp
set old (pwd)
while not test -e .env -o -e .idea -o -e .git
cd ..
if [ '/' = (pwd) ]
cd $old
echo 'Could not descend to a project directory'
return 1
Mechazawa / uuid.js
Created May 23, 2017
Safe uuid generator using the crypto api if possible
View uuid.js
import StaticClass from './StaticClass';
* UUID util class
* @static
* @protected
export default class Uuid extends StaticClass {
* Generate a UUID4 string

Keybase proof

I hereby claim:

  • I am Mechazawa on github.
  • I am shodan ( on keybase.
  • I have a public key whose fingerprint is DF27 3DDC 10E0 D5C0 5C62 AA8E D24A 9DCD DC84 0F6E

To claim this, I am signing this object:

import sys
import httplib
import xml.etree.ElementTree as ET
from xml.sax.saxutils import escape
from ftplib import FTP
import re
Terrible code ahead
We found this exploit ages ago. Never found out if anyone else knew
Mechazawa / index.html
Created Apr 8, 2014
sierpinski triangles
View index.html
<title>Sierpinski triangles in Liquidscript</title>
<script src="triangle.js"></script>
<body onload="sierpinski(100)">
<canvas id="result" width="800" height="800"></canvas>
View pifm.c
// To run:
// wget -O - 2>/dev/null | gcc -lm -std=c99 -g -xc - && time ./a.out
// Access from ARM Running Linux
#define BCM2708_PERI_BASE 0x20000000
#define GPIO_BASE (BCM2708_PERI_BASE + 0x200000) /* GPIO controller */
#include <stdio.h>
#include <string.h>