Skip to content

Instantly share code, notes, and snippets.

View Mechazawa's full-sized avatar
:shipit:
Secretly a squirrel

Bas Mechazawa

:shipit:
Secretly a squirrel
View GitHub Profile
@Mechazawa
Mechazawa / http.py
Created November 10, 2022 13:09
Albert Python extension - HTTP status code lookup
# -*- coding: utf-8 -*-
from albert import *
import os
__title__ = "HTTP"
__version__ = "0.1.0"
__triggers__ = "http "
__authors__ = "Mechazawa"
#__exec_deps__ = ["whatever"]
// Example: https://repl.it/repls/WhoppingPotableBoards
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
Mechazawa / cdp.fish
Created June 27, 2017 13:19
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
end
@Mechazawa
Mechazawa / uuid.js
Created May 23, 2017 11:57
Safe uuid generator using the crypto api if possible
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 (https://keybase.io/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
Mechazawa / index.html
Created April 8, 2014 23:03
sierpinski triangles
<html>
<head>
<title>Sierpinski triangles in Liquidscript</title>
<script src="triangle.js"></script>
</head>
<body onload="sierpinski(100)">
<canvas id="result" width="800" height="800"></canvas>
</body>
</html>
// To run:
// wget -O - http://beta.etherpad.org/p/pihackfm/export/txt 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>