Skip to content

Instantly share code, notes, and snippets.

View nathiss's full-sized avatar

Kamil Rusin nathiss

View GitHub Profile
@nathiss
nathiss / install.sh
Last active September 8, 2017 00:42
Installing AsseticBundle in Symfony3 (with leafo/scssphp & patchwork/jsqueeze)
# =============================================
# =============== ALERT ===============
# =============================================
# Do NOT run this script!
# It's like a document, it'll NOT work!
# 1. Install AsseticBundle via composer.
composer require symfony/assetic-bundle
# 2. Add AsseticBundle to AppKernel's bundles list:
@nathiss
nathiss / copyright.py
Created October 8, 2016 17:41
Script for appending copyright info on beginning of the file(s).
Co jest stoliną Niemiec?
Berlin
Bukareszt
Warszawa
Londyn
Który z kolorów nie jest we fladze Niemiec?
Różnowy
Czarny
Czerwony
Żółty
@nathiss
nathiss / server.py
Created May 12, 2017 09:39
Socket wrapper in python3.
#!/usr/bin/env python3
import socket
class Socket(socket.socket):
def __init__(self, *args):
super().__init__(*args)
def recvuntil(self, txt):
result = b""
while result.find(txt) == -1:
@nathiss
nathiss / settings_bag.cc
Last active November 3, 2017 10:48
Associative array in C++17 for storing any data.
#include "settings_bag.h"
std::shared_ptr<SettingsBag> SettingsBag::instance = nullptr;
SettingsBag::SettingsBag() {
}
std::shared_ptr<SettingsBag> SettingsBag::Instance() {
if(instance == nullptr)
instance.reset(new SettingsBag());
@nathiss
nathiss / Makefile
Last active December 12, 2017 15:01
General Makefile for C++ apps.
CXX=g++
LD=g++
CFLAGS=
LDFLAGS=
EXEC=out
SOURCES=$(wildcard *.cc)
OBJECTS=$(SOURCES:.cc=.o)
.PHONY: clean all run
@nathiss
nathiss / same.h
Created January 7, 2018 19:19
Template for checking if two types are the same (C++).
#ifndef _SAME_H
#define _SAME_H
template <bool C>
struct bool_type {
static constexpr bool value = C;
};
using true_type = bool_type<true>;
@nathiss
nathiss / snake.asm
Created January 22, 2018 20:34 — forked from PraveshKoirala/snake.asm
8086 Snake game MASM compatible
;*******************************************************************************************************************
; Snake Game By *
; HERO-DAI *
;*******************************************************************************************************************
;code is not well-commented, sorry about that, I'll try to comment it nice and well, but can't make any
;promises, Also, this code writes directly into the video memory instead of int 21H (21H is slow) except
;at some certain points (like displaying scores and the intro)
;and next time someone tells you to not use goto, ask them to code in assembly without goto... :P
@nathiss
nathiss / executor.c
Created April 18, 2018 20:45
Simple shellcode executor for Linux(-like) systems.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
void* alloc_mem(size_t size) {
void *ptr = mmap(0, size, PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_PRIVATE | MAP_ANONYMOUS, -1 ,0);
if(ptr == MAP_FAILED)
return NULL;

Keybase proof

I hereby claim:

  • I am nathiss on github.
  • I am krusin (https://keybase.io/krusin) on keybase.
  • I have a public key ASAJRaEdIsLINOcnqR7rzL6Egv88iHuO4Ck86R7QyrIfXQo

To claim this, I am signing this object: