Skip to content

Instantly share code, notes, and snippets.

Avatar
💔
Over-engineering a tool to create, install, and update Minecraft modpacks.

Jacob Birkett spikespaz

💔
Over-engineering a tool to create, install, and update Minecraft modpacks.
View GitHub Profile
@spikespaz
spikespaz / ConcurrentLineWriter.py
Created Mar 25, 2020
Experimental concurrent line writer
View ConcurrentLineWriter.py
class ConcurrentLineWriter:
class LineFileIO(StringIO):
def __init__(self, parent, row):
super().__init__()
self.parent = parent
self.row = row
def write(self, string):
super().write(string)
self.parent._write(self.row)
View Python_Snippets.md

Python Snippets

Blocks of code that may become useful later.

@spikespaz
spikespaz / EmbedJS.md
Last active Feb 20, 2018
JavaScript include that converts all anchor elements with the "--embed" class into highlighted code blocks (http://embed.spikespaz.com)
View EmbedJS.md

EmbedJS

This is a script to embed raw text into a page as highlighted code. It uses ajax requests to fetch the raw content from the URL inside of an anchor element, and then [highlight.js][0] to render the code.

The benefit of this over Github's gist embedding is that it can be used in a full page. If you want to mirror a Gist to [StackOverflow][1] for example, this script can be wrapped inside of a code snippet. Every time the gist that the code snippet points to is updated, the code rendered on StackOverflow will also update.

You can’t perform that action at this time.