Skip to content

Instantly share code, notes, and snippets.

@greg76
greg76 / scroll.py
Last active May 4, 2020 10:11
old school sinus text demoscene effect for starting experimenting with pyxel retro game engine
import math
import random
import pyxel
class Intro:
def __init__(self):
pyxel.init(160, 120, caption="Twin Sectors")
self.amplitude = 10
@greg76
greg76 / aws-polly.py
Created November 9, 2018 13:13
simple example on how to "text-to-speech" with amazon's polly service
#!/usr/bin/env python3
from boto3 import client
from contextlib import closing
polly = client("polly", 'us-east-1')
voice = 'Brian'
response = polly.synthesize_speech(
Text='''Imagine how your bullet points turn into presenter notes!
@greg76
greg76 / NASM.sublime-build
Created September 19, 2018 20:26
Build and run x86 asm files on MacOS with NASM and DosBox
{
"shell": true,
"env": {
"DOSBOX": "/Applications/DOSBox.app/Contents/MacOS/DOSBox"
},
"cmd": ["nasm -f bin ${file} -o ${file_base_name}.com && \\$DOSBOX -c \"MOUNT C ${file_path}\" ${file_base_name}.com"],
"file_regex": "^(.+):([0-9]+)()?: error: (.*)$",
"working_dir": "${file_path}",
"selector": "source.assembly",
}
@greg76
greg76 / display.py
Last active March 14, 2018 22:06
simple script to display either the arguments or the first lines of whatever is being piped into it to an SSD1306 driven oled screen
#!/usr/bin/python3
import sys
import Adafruit_GPIO.SPI as SPI
import Adafruit_SSD1306
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
disp = Adafruit_SSD1306.SSD1306_128_32(rst=None)
@greg76
greg76 / pocketmine.sh
Last active March 26, 2020 10:54
simple shell script to run pocketmine as a service/daemon
#!/bin/sh
### BEGIN INIT INFO
# Provides: pocketmine
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6