Skip to content

Instantly share code, notes, and snippets.

View sysint64's full-sized avatar
:shipit:

Andrei Kabylin sysint64

:shipit:
View GitHub Profile
@charlesastaylor
charlesastaylor / -sna86.asm
Last active March 11, 2024 23:54
8086 assembly snake game!
; -------------------------------------------------------------------
; Sna86.
; An 8086 simulator snake!
; -------------------------------------------------------------------
;
; Assembly program intended to run in an 8086 simulator with functionaliy equal* to one made for homeworks
; up to Part 1 Episode 10 of the Peformance-Aware Programming Series (https://www.computerenhance.com/)
; by Casey Muratori. Demo - https://youtu.be/s_S4-QHeFMc.
;
; * mov, add, sub, cmp, je and jne was the target instructions. However I also added loop for convenience,
@gcatlin
gcatlin / sdl-metal-example.m
Last active April 20, 2024 13:04
Minimal C SDL2 Metal example
//
// cc sdl-metal-example.m `sdl2-config --cflags --libs` -framework Metal -framework QuartzCore && ./a.out
//
#include <SDL.h>
#import <Metal/Metal.h>
#import <QuartzCore/CAMetalLayer.h>
int main (int argc, char *args[])
{
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "metal");
import macros
type
SmallType = object
z: float
MyType = object
a: int
b: int
c: string
@troyfontaine
troyfontaine / 1-setup.md
Last active April 24, 2024 14:19
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@goude
goude / gist:b44b9d3938d3d30d8873f34fe2f92057
Created March 20, 2017 09:35
Generate and insert a UUID in vim
:r !uuidgen|sed 's/.*/"uid": "&",/'
@mcandre
mcandre / public-trackers.md
Last active February 11, 2024 09:18
List of public BitTorrent tracker announce URLs
@leplatrem
leplatrem / yourapp
Last active September 24, 2023 23:01
gunicorn virtualenv init.d script (could be simpler with upstart)
#! /bin/bash
### BEGIN INIT INFO
# Provides: yourapp
# Required-Start: nginx
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: The main django process
# Description: The gunicorn process that receives HTTP requests
# from nginx
@jcinis
jcinis / gist:2866253
Created June 4, 2012 04:02
Generate a random username for Django
from random import choice
from string import ascii_lowercase, digits
from django.contrib.auth.models import User
def generate_random_username(length=16, chars=ascii_lowercase+digits, split=4, delimiter='-'):
username = ''.join([choice(chars) for i in xrange(length)])
if split:
username = delimiter.join([username[start:start+split] for start in range(0, len(username), split)])
@mkottman
mkottman / twoline_prompt.sh
Last active July 19, 2023 06:53
A two-line colored Bash prompt (PS1) with Git branch and a line decoration which adjusts automatically to the width of the terminal. Recognizes SVN, Git and Fossil version control systems and shows the current branch/revision.
# A two-line colored Bash prompt (PS1) with Git branch and a line decoration
# which adjusts automatically to the width of the terminal.
# Recognizes and shows Git, SVN and Fossil branch/revision.
# Screenshot: http://img194.imageshack.us/img194/2154/twolineprompt.png
# Michal Kottman, 2012
RESET="\[\033[0m\]"
RED="\[\033[0;31m\]"
GREEN="\[\033[01;32m\]"
BLUE="\[\033[01;34m\]"