Skip to content

Instantly share code, notes, and snippets.

View mcmacker4's full-sized avatar
๐Ÿ™ƒ

Hans mcmacker4

๐Ÿ™ƒ
  • Spain
View GitHub Profile
@mcmacker4
mcmacker4 / bios_print.asm
Last active August 27, 2020 14:13
My first boot sector, printing a message using bios routines.
; nasm -fbin bios_print.asm -o bios_print.o
; qemu-system-i386 -drive file=bios_print.o,format=raw
bits 16
org 0x7C00
; Set Up Real Mode Segments
mov ax, 0
mov ds, ax
mov es, ax
@mcmacker4
mcmacker4 / mc_fish_prompt.fish
Last active August 6, 2020 21:07
My personal custom fish shell prompt
# name: mc's prompt
# author: Hans Geel
# installation
# for single user: ~/.config/fish/conf.d/mc_fish_prompt.fish
# for all users: /etc/fish/conf.d/mc_fish_prompt.fish
function mc_git_prompt
set gitbranch (git branch --show-current 2> /dev/null)
if test $status -eq 0
set gitchanges (git status -s)
@mcmacker4
mcmacker4 / .zshrc
Last active December 4, 2019 21:41
plugins=(
git
git-flow
archlinux
# common-aliases
# dirhistory
httpie
node
npm
# pip
@mcmacker4
mcmacker4 / challenge.csv
Last active July 2, 2019 21:32
rpachallenge
John Smith IT Solutions Analyst 98 North Road jsmith@itsolutions.co.uk 40716543298
Jane Dorsey MediCare Medical Engineer 11 Crown Street jdorsey@mc.com 40791345621
Albert Kipling Waterfront Accountant 22 Guild Street kipling@waterfront.com 40735416854
Michael Robertson MediCare IT Specialist 17 Farburn Terrace mrobertson@mc.com 40733652145
Doug Derrick Timepath Inc. Analyst 99 Shire Oak Road dderrick@timepath.co.uk 40799885412
Jessie Marlowe Aperture Inc. Scientist 27 Cheshire Street jmarlowe@aperture.us 40733154268
Stan Hamm Sugarwell Advisor 10 Dam Road shamm@sugarwell.org 40712462257
Michelle Norton Aperture Inc. Scientist 13 White Rabbit Street mnorton@aperture.us 40731254562
Stacy Shelby TechDev HR Manager 19 Pineapple Boulevard sshelby@techdev.com 40741785214
Lara Palmer Timepath Inc. Programmer 87 Orange Street lpalmer@timepath.co.uk 40731653845
fun main() {
val days = readLine()!!.toInt()
val visits = readLine()!!.split(" ").map { it.toInt() }
var count = 0
val top = arrayOf(0, 0)
for (i in 0 until days) {
@mcmacker4
mcmacker4 / App.kt
Last active May 22, 2019 18:50
The simplicity of Kotlin DSLs
typealias RequestHandler = Context.() -> Unit
data class Context(val path: String) {
val headers = hashMapOf<String, String>()
var body: String? = null
}
class Application(builder: Builder.() -> Unit) {
private val routes = arrayListOf<Route>()
@mcmacker4
mcmacker4 / data.json
Created September 29, 2017 14:22
Bot for discord bug report 3865
{
"token": "<bot's token here>",
"guildId": "<the guild's id where the testing will happen>",
"memberId": "<unsuspecting victim's id>"
}
@mcmacker4
mcmacker4 / CMakeLists.txt
Created April 9, 2017 17:07
CMakeLists.txt for OpenGL with GLEW + GLFW on Linux.
# This is for using GLFW + GLEW once they are built and installed on your system
# IMPORTANT: GLEW libraries will be installed in /usr/lib64 but the system won't
# look for them there. You need to tell the OS to look for them there by setting
# the following environment variable: LD_LIBRARY_PATH=/usr/lib64
cmake_minimum_required(VERSION 3.5)
project(myproject)
set(CMAKE_CXX_STANDARD 11)
@mcmacker4
mcmacker4 / discord-embedder.js
Created March 10, 2017 23:04
Discord bot that edits "embed" language code blocks into actual embeds.
const Discord = require("discord.js");
const bot = new Discord.Client();
bot.on("ready", () => console.log("Ready"));
bot.on("message", (message) => {
if(message.author.id === bot.user.id) {
let pattern = /([\W\w]*)```embed([\W\w]*)```/igm;
let match = pattern.exec(message.content);
if(match) {
@mcmacker4
mcmacker4 / step5.c
Last active February 3, 2017 10:04
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
For this step i have implemented a very simple resizable list that will contain
the lines of the origin file. This way, the file can have any number of lines
while other implementations can only handle a limited number of lines.
*/