Skip to content

Instantly share code, notes, and snippets.

View alecnunn's full-sized avatar
🏳️‍🌈

Alec alecnunn

🏳️‍🌈
View GitHub Profile
@alecnunn
alecnunn / random_imgur.py
Created July 17, 2012 04:51
random imgur downloader (v2 with threading!) e: fixed a bug, removed tabs :)
import os
import sys
import random
import time
import string
import Queue
import threading
from urllib2 import Request, urlopen, URLError, HTTPError
CHARS = string.letters + string.digits
@alecnunn
alecnunn / short.py
Created July 17, 2012 04:51 — forked from darkf/short.py
nanoshorten
# nanoshorten - a very tiny URL shortener Web application written in Bottle and sqlite
# copyright (c) 2012 darkf
# licensed under the WTFPL (WTF Public License)
# see http://sam.zoy.org/wtfpl/ for details
from bottle import get, request, run
import sqlite3, random, string
con = sqlite3.connect('short.db')
c = con.cursor()
@alecnunn
alecnunn / mrisc.rb
Created July 17, 2012 04:51 — forked from pachacamac/mrisc.rb
A Simple Assembler Language and VM
#!/usr/bin/env ruby
class MRISC
def run(code)
tokens = code.gsub(/(\*.*?\*)|[^a-z0-9,-;@\._]/,'').split(';')
@vars,stack,i = {:_pc=>-1,:_oc=>0},[],0
tokens.map!{|t| t.chars.first=='@' ? (@vars[t.to_sym]=i-1;nil) : (i+=1;t.split(',').map{|e|numeric?(e) ? e.to_i : e.to_sym})}.compact!
while @vars[:_pc] < tokens.size-1
@vars[:_pc] += 1
@vars[:_oc] += 1
@alecnunn
alecnunn / tinystackr3.py
Created July 17, 2012 04:52 — forked from vgel/tinystackr3.py
Tiny stack-based language in python.
stack = []
compileStacks = []
words = {}
builtins = {}
lambdaType = type(lambda x: x) #cannot compare against the function type directly for some reason
def prn(o):
print(o)
def clr(l):
@alecnunn
alecnunn / miner.vb
Last active December 16, 2015 18:40
A basic benchmark miner for BlooCoin written in Visual Basic.
Module Module1
Sub Main()
mine("kNTny")
Console.Read()
End Sub
Dim winning As String = "0000000"
Sub mine(ByVal seed As String)
Dim num As Integer = 0
import socket
import multiprocessing
import string
import random
import json
import hashlib
import sys
import time
class BLCMiner:
@alecnunn
alecnunn / tnt-miner-solutions.tx
Last active December 17, 2015 10:18 — forked from danneu/tnt-miner-solutions.tx
added another thousand or so
hItuE25058127
6uGdS64633551
iZ8Yg129410073
mn9Ni177063744
tvUy62899300
LlcJs181693848
rRNp274174151
UsiSz5027013
DH4Yd88472413
eEIN376415610
__author__ = "Alec Nunn"
from pysphere import VIServer, MORTypes
#--------------------------------------------------------
# CONFIGURATION
#--------------------------------------------------------
# IP OF SERVER
hostIP = ""
# USERNAME
__author__ = "Alec Nunn"
from pysphere import VIServer
from pysphere.resources import VimService_services as VI
#--------------------------------------------------------
# CONFIGURATION
#--------------------------------------------------------
hostIP = ""
user = ""