Skip to content

Instantly share code, notes, and snippets.

View Plastix's full-sized avatar

Aidan Pieper Plastix

View GitHub Profile
\documentclass[11pt]{article}
\usepackage{fancyhdr}
\usepackage{extramarks}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\usepackage{courier}
@Plastix
Plastix / recursion_examples.scm
Created January 14, 2017 13:20
Functional programming exercises/examples in Scheme
;; fact -- Returns the factorial of a given positive integer.
(define fact
(lambda (n)
(if (eq? n 0) 1 (* n (fact (- n 1))))))
;; list-length - return length of a list.
(define list-length
(lambda (L)
(if (null? L)
@Plastix
Plastix / lambda.scm
Created January 14, 2017 13:13
Lambda!
((lambda (lambda) (lambda lambda)) (lambda (lambda) lambda))
@Plastix
Plastix / parity.ss
Created January 6, 2017 01:48
Pair recursive functions in Scheme
(define odd?
(lambda (n)
(cond
[(zero? n) #f]
[else (even? (- n 1))])))
(define even?
(lambda (n)
(cond
[(zero? n) #t]
@Plastix
Plastix / SmartEnchant.py
Last active August 29, 2015 13:57
A MCEdit filter for batch editing enchantments on items
# Smart Enchant - A MCEdit filter for batch editing enchantments on items
# Modified by Plastix
# Original Enchant Filter by SethBling
from pymclevel import MCSchematic
from pymclevel import TileEntity
from pymclevel import TAG_Compound
from pymclevel import TAG_Short
from pymclevel import TAG_Byte
from pymclevel import TAG_String
@Plastix
Plastix / SmartEnchant.py
Created January 1, 2014 02:59
A mcedit filter used for batch enchanting items in containers. This is a modification of Sethbling's original enchantment filter. This version allows for selected items to be enchanted.
# Smart Enchant
# Modifed by Plastix 12/23/12
# Original Enchant Filter by SethBling
from pymclevel import MCSchematic
from pymclevel import TileEntity
from pymclevel import TAG_Compound
from pymclevel import TAG_Short
from pymclevel import TAG_Byte
from pymclevel import TAG_String
@Plastix
Plastix / Silhouette.py
Created January 1, 2014 02:56
A mcedit filter used for making Minecraft maps work with the PGM 2.0 voidmatcher.
# Silhouette.py - Casts a Silhouette of the map onto y=0
# MCEdit Filter
# Made for use with PGM v2.0 Voidmatcher
# Made by khazhyk
import sys
inputs = (
("Fill with","blocktype"),
)
@Plastix
Plastix / name_checker.php
Created December 30, 2013 17:00
PHP script used for checking the availability of Minecraft usernames. Requires a text file called names.txt in the same directory as the script with one name per line. Available names are saved to available_names.txt.
<?php
// Checks the availability of Minecraft usernames given a text file of names
$names = Array();
$input = "./names.txt"; //Names to be checked (one per line)
$output= "./available_names.txt"; //Available names
$names = file($input, FILE_IGNORE_NEW_LINES);
if(file_exists($output)) file_put_contents($output, "");
foreach( $names as $name ) {