Skip to content

Instantly share code, notes, and snippets.

View SamusAranX's full-sized avatar

SamusAranX

  • Germany
  • 03:47 (UTC +02:00)
View GitHub Profile
Replace 104 bytes at $3204 with the following.
This stores the animated color palette for the letters, and the static color palette for the shimmer.
16 70 E0 01 1E 68 B0 01 1F 7C F0 01 0B 64 E0 01
1D 50 60 01 1F 7C F0 01 0B 64 E0 01 1D 50 60 01
1F 7C F0 01 0B 64 E0 01 1D 50 60 01 1F 7C F0 01
0B 64 E0 01 1D 50 60 01 1F 7C F0 01 0B 64 E0 01
1D 50 60 01 1F 7C F0 01 0B 64 E0 01 1D 50 60 01
1F 7C F0 01 1F 7C F0 01 1F 7C F0 01 1F 7C F0 01
1F 00 FF 7F F7 5E EF 3D
@uobikiemukot
uobikiemukot / emoji.go
Created December 11, 2018 07:58
emoji and text renderer
package main
import (
"bufio"
"bytes"
"fmt"
"image"
"image/jpeg"
_ "image/png"
"io"
@justincjahn
justincjahn / README.md
Last active January 16, 2024 20:15
Minecraft server(s) using systemd and screen.

Install

# Install dependencies
sudo yum install -y java-1.8.0-openjdk screen

# Create a new unprivileged user for minecraft
useradd -r -m -d /opt/minecraft minecraft

# Create the directory that will house our minecraft instances

sudo su --shell /bin/bash minecraft

@ndarville
ndarville / README.md
Last active September 21, 2023 21:34
How to export and rehost your Tumblr site

How to export and rehost your Tumblr site

(Update: Version 3.2.0 of Jekyll looks like it's breaking a few things, so I've changed the guide to make you specifically install the version I was using, 3.1.3. I believe this is the issue: jekyll/jekyll#5145.)

You will be using jekyll-import to export your Tumblr site, Jekyll to (re)create it, and Surge to rehost it.

Update: You can also use Tumblr's native export feature in your blogs' individual settings. But rehosting that might be tricky. Read my comments below this post for how that works.

Setup and installation

@wido
wido / random-ipv6-addr.py
Last active May 31, 2023 18:43
Generate a random IPv6 address
#!/usr/bin/env python3
"""
Generate a random IPv6 address for a specified subnet
"""
from random import seed, getrandbits
from ipaddress import IPv6Network, IPv6Address
subnet = '2001:db8:100::/64'
@BenjyWiener
BenjyWiener / Add Screen Recorder Button.py
Last active September 15, 2017 08:06
Screen recorder for Pythonista
# coding: utf-8
from objc_util import *
from ReplayKit import *
from console import alert
import ui
UIBarButtonItem = ObjCClass('UIBarButtonItem')
def main():
@mayoff
mayoff / appfont-fontello-config.json
Last active November 12, 2018 19:37
Playground for drawing a UILabel with attributed text containing icons from a custom font
{
"name": "appfont",
"css_prefix_text": "icon-",
"css_use_suffix": false,
"hinting": true,
"units_per_em": 1000,
"ascent": 850,
"glyphs": [
{
"uid": "324e9013e79ecf9e0e30a07feffa9d6b",
@JimBobSquarePants
JimBobSquarePants / GifEncoder
Created October 16, 2014 22:29
An animated gif encoder in c#
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="GifEncoder.cs" company="James South">
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// </copyright>
// <summary>
// Encodes multiple images as an animated gif to a stream.
// <remarks>
// Always wire this up in a using block.
// Disposing the encoder will complete the file.
@hest
hest / gist:8798884
Created February 4, 2014 06:08
Fast SQLAlchemy counting (avoid query.count() subquery)
def get_count(q):
count_q = q.statement.with_only_columns([func.count()]).order_by(None)
count = q.session.execute(count_q).scalar()
return count
q = session.query(TestModel).filter(...).order_by(...)
# Slow: SELECT COUNT(*) FROM (SELECT ... FROM TestModel WHERE ...) ...
print q.count()
@boneskull
boneskull / uninstall_vmware.sh
Created January 14, 2014 04:46
completely uninstall vmware on mac
#!/usr/bin/env bash
# Usage: bash uninstall_vmware.bash
remove() {
entry="$1"
echo -ne "Removing \e[1;34m$entry\e[0m... "
sudo rm -rf "$entry" &> /tmp/uninstall-vmware.log
if [[ ! -e "$entry" ]]; then
echo -e "\e[1;32mOK\e[0m"