Skip to content

Instantly share code, notes, and snippets.

View Lambdanaut's full-sized avatar
👁️‍🗨️
λ

Joshua Quirk Lambdanaut

👁️‍🗨️
λ
View GitHub Profile
@Lambdanaut
Lambdanaut / zoia-ctrl.py
Last active February 6, 2024 01:06
zoia-ctrl.py
"""
zoia-ctrl.py
==============
Command line script to manage ZOIA file patches in a directory
Usage
-----
For renaming all files sequentially:
@Lambdanaut
Lambdanaut / .rs
Created May 11, 2022 00:39
Pathfinding.rs
use std::cmp;
use std::cmp::Reverse;
use std::collections::BinaryHeap;
use std::collections::HashMap;
use std::sync::mpsc;
use std::thread;
use std::vec::Vec;
use gdnative::prelude::*;
use gdnative::api::TileMap;
### Keybase proof
I hereby claim:
* I am lambdanaut on github.
* I am lambdanaut (https://keybase.io/lambdanaut) on keybase.
* I have a public key ASC_Aazu1TL5v-Ce2Sm4MCQ1wOuUg-ZIdnh9jdyDfr6YJgo
To claim this, I am signing this object:
@Lambdanaut
Lambdanaut / sillycoin.py
Created April 25, 2017 03:57
A cryptocoin wip from scratch
import json
from Crypto.Random import random
from Crypto.PublicKey import RSA
from Crypto.Hash import SHA
import constants
from utils import rando
@Lambdanaut
Lambdanaut / bloom.py
Last active August 25, 2016 02:24
Space-efficient Bloom filter in Python
"""
EXAMPLE
>> bloom = Bloom(1000000, 6) # Instantiate a Bloom filter of size 100,000 with 6 runs through the hash function
>> [bloom.insert(str(x)) for x in range(10000)] # Insert the integers from 0-9999 into the Bloom Filter
>> all([bloom.lookup(str(x)) for x in range(10000)]) # Ensure all values were entered correctly
True
"""
import random
class MM(object):
def __init__(self):
# Wordlist form = ['this','is','words']
# Graph form = [((1,1)],[(2,1)],[]]
# [((count, index)],[(count, index)],[]]
self.wordlist = []
self.graphlist = []
@Lambdanaut
Lambdanaut / gist:d980fb47e66a1a6dbd9b
Last active August 29, 2015 14:07
PHP Candidate interview questions
## Q
CSS:
Explain the difference between visibility:hidden; and display:none;
## A
Visibility:Hidden; - It is not visible but takes up it's original space.
Display:None; - It is hidden and takes up absolutely no space as if it was never there.
@Lambdanaut
Lambdanaut / vq.py
Created June 9, 2014 22:33
Integer Vector Quantization
""" Classifies a point as belonging to a cluster of points """
from math import sqrt
from random import shuffle
WIDTH = 28
HEIGHT = 28
POINT_TO_CLASSIFY = (2,4)
@Lambdanaut
Lambdanaut / ann.hs
Created March 10, 2014 21:53
Artificial Neural Network
module Main where
config_input_cells = 1 :: Int
config_hidden_layer_cells = 10 :: Int
config_hidden_layers = 2 :: Int
config_output_cells = 1 :: Int
-- [ [ (Threshhold, [Connection Weights] ) ] ]
type Net = [ [ (Double, [Double] ) ] ]
@Lambdanaut
Lambdanaut / gist:6134156
Created August 1, 2013 18:54
A script to flood a phisher's database with fake usernames and passwords. For great justice.
import requests
import random
target = "http://mtgox.com.bz/login.php"
wordlist_file = "wordlist"
wordlist = open(wordlist_file, "r").readlines()
wordlist_len = len(wordlist)
while True: