Skip to content

Instantly share code, notes, and snippets.

View sysint64's full-sized avatar
:shipit:

Andrei Kabylin sysint64

:shipit:
View GitHub Profile
@sysint64
sysint64 / -sna86.asm
Created December 24, 2023 17:24 — forked from charlesastaylor/-sna86.asm
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,
#!/usr/bin/env python
import argparse
import requests
import sys
parser = argparse.ArgumentParser(description='Github statuses api helper.')
parser.add_argument('--owner', type=str, help="a repository owner", required=True)
parser.add_argument('--repo', type=str, help="repository name", required=True)
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
struct Node {
int data;
struct Node* next;
struct Node* prev;
} typedef Node;
public String getPlaceholderText(@NotNull final ASTNode node) {
...
if (psi instanceof DLanguageBlockStatement) {
final DLanguageBlockStatement block = (DLanguageBlockStatement) psi;
final PsiElement inner = getInnerStatementBlockForDisplayInPlaceholder(block);
if (inner != null) {
return "{ " + inner.getText().trim() + " }";
} else {
class MyView : View {
@ViewWidget Button okButton;
@ViewWidget Panel testPanel;
@ViewWidget("cancelButton") Button myButton;
@GroupViewWidgets Button[3] buttons;
int a = 0;
this(Manager manager, in string laytoutFileName, in string shortcutsFileName) {
super(manager, laytoutFileName, shortcutsFileName);
@sysint64
sysint64 / twoline_prompt.sh
Created May 13, 2017 11:07 — forked from mkottman/twoline_prompt.sh
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\]"
@sysint64
sysint64 / group_android_res.py
Created March 1, 2017 06:39
copy android files with suffixes hdpi, mdpi etc. to folders minimap-hdpi, minimap-mdpi etc. without suffixes.
import glob, os
from shutil import copyfile
suffixes = [
"xxxhdpi",
"xxhdpi",
"xhdpi",
"hdpi",
"mdpi",
]
def restore_disks(size, action_index, action_count, from_axis, to_axis):
pivot = action_count // 2
free_axis = _select_axis(from_axis, to_axis)
part_count = action_count - pivot - 1
if action_index == pivot:
axises[from_axis].append(size)
for i in range(size-1, 0, -1):
axises[free_axis].append(i)
@sysint64
sysint64 / hanoy.py
Last active December 1, 2016 16:21
current_tower = 0
target_axis = 2
axises = [
[6, 5, 4, 3, 2, 1],
[],
[]
]
def _select_axis(tower_index, axis):
axises_indexes = [0, 1, 2]
@sysint64
sysint64 / palette.h
Created May 25, 2016 17:47
Палитра 4 битная и 8 битная
#pragma once
uint8_t RGB4_Palette[][3] = {
{ 0 , 0 , 0 }, // Black
{ 255, 255, 255 }, // White
{ 255, 0 , 0 }, // Red
{ 0 , 255, 0 }, // Lime
{ 0 , 0 , 255 }, // Blue
{ 255, 255, 0 }, // Yellow
{ 0 , 255, 255 }, // Cyan / Aqua