Skip to content

Instantly share code, notes, and snippets.

@Kawzeg
Kawzeg / collect_maps.py
Last active February 13, 2021 08:44
Gitland map collector
import os
import git
import markdown
from weasyprint import HTML, CSS
from pdf2image import convert_from_path
# Copied from gitland server.py
def mapToMd(map):
return map.replace('ux', '![](icons/ux)').replace('ug', '![](icons/ug)').replace('ur', '![](icons/ur)').replace('ub', '![](icons/ub)').replace('cg', '![](icons/cg)').replace('cr', '![](icons/cr)').replace('cb', '![](icons/cb)').replace(',', ' ').strip().replace('\n', ' \n')
@Kawzeg
Kawzeg / Pat.java
Last active April 20, 2022 12:24
Create .eml files with javax.mail
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import java.awt.*;
import java.io.File;
import java.io.FileOutputStream;
@Kawzeg
Kawzeg / ants.clj
Created October 22, 2017 09:59 — forked from michiakig/ants.clj
Clojure ant sim from Rich Hickey
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright (c) Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
; Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
; which can be found in the file CPL.TXT at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; the terms of this license.
; You must not remove this notice, or any other, from this software.
;dimensions of square world