Skip to content

Instantly share code, notes, and snippets.

View MostAwesomeDude's full-sized avatar

Corbin Simpson MostAwesomeDude

View GitHub Profile

Consider one single vat. There are objects in this vat. With the exception of some types, listed below, all objects are made of pure S code. The difference between a builtin type and an object made from S code is not visible from within the object space; for all objects, only message passing can be used to communicate and no object introspection is possible.

Note that "type" simply means "a template for an object." There is no visible difference between a function which returns an object and a type, nor is there any typechecking per se.

Here are some builtin types. This list is not yet exhaustive, but it won't get much longer. Types without literal syntax have a + next to them, and have quasiliteral syntax instead.

  • int
  • float
  • str: Unicode strings.
  • bytes+: Bytestrings. bytes is important because it is the type of objects which are used as identifiers and message names.
Powers of Two
Assume: http://en.wikipedia.org/wiki/Fundamental_theorem_of_arithmetic
Assume: No power of two is divisible by three.
Assume: In any three sequential integers, exactly one is divisible by three.
Even powers of two are congruent to 3 mod 1. Proof:
@MostAwesomeDude
MostAwesomeDude / puyo.fall
Last active December 18, 2015 11:39
Hmmm.....
blocks = {
|&*,
}
colors = {red, green, blue, yellow, white}
discrete
stick immediately
exports (main)
object nullStream as DeepFrozen:
to _printOn(out):
out.print("null")
to map(_):
return nullStream
to fold(_, x):
import "lib/streams" =~ [=> flow :DeepFrozen]
exports (main)
def main(argv, => makeTCP4ServerEndpoint) as DeepFrozen:
def ep := makeTCP4ServerEndpoint(7777)
ep.listenStream(flow)
return 0
from collections import defaultdict
import string
words = open("wordsEn.txt", "rb").read().split("\r\n")
words.sort(key=lambda k: (-len(k), k))
def longestWordsByLetter(k):
remaining = dict((c, k) for c in string.lowercase)
rv = defaultdict(list)
for word in words:
import math
BASE = 4
def XPForLevel(level):
"The amount of XP to reward for a given power level."
return int(BASE ** level)
print "Level 2.7 enemy is worth", XPForLevel(2.7)
#!/usr/bin/env nix-shell
#! nix-shell -i python -p pythonPackages.twisted pythonPackages.prometheus_client
from twisted.internet.task import deferLater, react
from twisted.web.server import Site
from twisted.web.resource import Resource
from prometheus_client.twisted import MetricsResource
def main(reactor):
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p python27Packages.scrapy jq
echo "https://$1/" > urls.txt
scrapy runspider siege.py -a domain=$1 -t json -o - | jq -r '.[] | .url' >> urls.txt
# -*- coding: utf-8 -*-
import scrapy
from scrapy.linkextractors import LinkExtractor
class SiegeSpider(scrapy.Spider):
name = "siege"
def __init__(self, domain, *args, **kwargs):
super(SiegeSpider, self).__init__(*args, **kwargs)
urlBase = 'https://%s/' % domain