Skip to content

Instantly share code, notes, and snippets.

View MSylvia's full-sized avatar
💭
Compiling ....

Matt Sylvia MSylvia

💭
Compiling ....
View GitHub Profile
@MSylvia
MSylvia / generate.c
Created March 5, 2019 14:33 — forked from munificent/generate.c
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@MSylvia
MSylvia / Game1.cs
Created January 8, 2019 15:28 — forked from moolicc/Game1.cs
MonoGame backend sample for ImGui.NET (https://github.com/mellinoe/ImGui.NET)
using System;
using System.Runtime.InteropServices;
using ImGuiNET;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using Vector2 = ImGuiNET.Vector2;
using Vector3 = ImGuiNET.Vector3;
using Vector4 = ImGuiNET.Vector4;
@MSylvia
MSylvia / Game1.cs
Created January 8, 2019 15:27 — forked from Jjagg/Game1.cs
MonoGame backend sample for ImGui.NET (https://github.com/mellinoe/ImGui.NET)
using System;
using System.Runtime.InteropServices;
using ImGuiNET;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using Vector2 = ImGuiNET.Vector2;
using Vector3 = ImGuiNET.Vector3;
using Vector4 = ImGuiNET.Vector4;
@MSylvia
MSylvia / createmyguest.sh
Created April 27, 2018 13:51
check Rich's updated version of this at https://gist.github.com/rtrouton/8016797
#!/bin/bash
#variables
DSCL="/usr/bin/dscl"
SECURITY="/usr/bin/security"
LOGGER="/usr/bin/logger"
OSREL=`/usr/bin/uname -r | cut -f 1 -d '.'`;
case "${OSREL}" in
10)
@MSylvia
MSylvia / resize_gif.py
Created April 17, 2018 14:37 — forked from plallin/resize_gif.py
Extract frames from an animated GIF, correctly handling palettes and frame update modes
from PIL import Image
'''
Based on a script by BigglesZX: https://gist.github.com/BigglesZX/4016539
BigglesZX was adapted as follows:
- Updated to be compatible with Python 3.
- The original function 'processImage' was renamed 'extract_and_resize_frames' and was adapted as follows:
- It resizes each frames as it extracts them
- It saves all the frames to an array
@MSylvia
MSylvia / gifextract.py
Created April 17, 2018 14:36 — forked from BigglesZX/gifextract.py
Extract frames from an animated GIF, correctly handling palettes and frame update modes
import os
from PIL import Image
'''
I searched high and low for solutions to the "extract animated GIF frames in Python"
problem, and after much trial and error came up with the following solution based
on several partial examples around the web (mostly Stack Overflow).
There are two pitfalls that aren't often mentioned when dealing with animated GIFs -
@MSylvia
MSylvia / osx_bootable_iso.sh
Created March 6, 2018 21:17 — forked from un33k/osx_bootable_iso.sh
Create bootable OSX ISO
#!/bin/bash
# Use with care ...
# -----------------------------------------
# Mountain Lion, Mavericks, Yosemite ..
OS=Yosemite
# Mount the installer image
hdiutil attach /Applications/Install\ OS\ X\ "$OS".app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
@MSylvia
MSylvia / mk.osx.iso.sh
Created March 6, 2018 21:17 — forked from un33k/mk.osx.iso.sh
Make_OSX_Installable_ISO
#!/bin/bash
# Use with care ...
OS="Yosemite"
IMG_SIZE=8g
BUILD_MNT=/tmp/"$OS"_Build
INSTALL_MNT=/tmp/"$OS"_Install
INSTALL_DMG=/Applications/Install\ OS\ X\ "$OS".app/Contents/SharedSupport/InstallESD.dmg
@MSylvia
MSylvia / hello-boot.asm
Created January 30, 2018 15:02 — forked from yackx/hello-boot.asm
Hello World bootloader in assembly language
;----------------------------------------------;
;
; A minimal bootloader that prints a hello world
; then halts.
;
; nasm -f bin hello-boot.asm -o hello-boot.bin
;
; @YouriAckx
;
;----------------------------------------------;
@MSylvia
MSylvia / 32.asm
Created January 30, 2018 15:00 — forked from FiloSottile/32.asm
NASM Hello World for x86 and x86_64 Intel Mac OS X (get yourself an updated nasm with brew)
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
start:
push dword msg.len
push dword msg
push dword 1
mov eax, 4