Skip to content

Instantly share code, notes, and snippets.

View armornick's full-sized avatar

Nick Arnoeyts armornick

  • Belgium
View GitHub Profile
@armornick
armornick / playwav.c
Created August 24, 2012 07:31
Play a sound with SDL2 (no SDL_Mixer)
#include <SDL2/SDL.h>
#define MUS_PATH "Roland-GR-1-Trumpet-C5.wav"
// prototype for our audio callback
// see the implementation for more information
void my_audio_callback(void *userdata, Uint8 *stream, int len);
// variable declarations
static Uint8 *audio_pos; // global pointer to the audio buffer to be played
@armornick
armornick / openicon.c
Created August 23, 2012 08:47
Draw an Image with SDL2
#include <stdio.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#define WIDTH 800
#define HEIGHT 600
#define IMG_PATH "exit.png"
int main (int argc, char *argv[]) {
@armornick
armornick / tumblr-theme-boilerplate.html
Created July 12, 2023 06:54
Tumblr theme boilerplate
<!--
BOILERPLATE FOR TUMBLR THEME DEVELOPMENT
Based on the code from <https://buildthemes.tumblr.com/>
Available under the 0BSD license (https://opensource.org/license/0bsd/)
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@armornick
armornick / tumblr-theme.html
Last active July 7, 2023 11:59
My first tumblr theme
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="Description" content="{MetaDescription}" />
<title>{block:SearchPage}{lang:Search results for SearchQuery} - {/block:SearchPage}{block:PostTitle}{PostTitle} - {/block:PostTitle}{Title}</title>
<link rel="shortcut icon" href="{Favicon}" />
<link rel="apple-touch-icon" href="{PortraitURL-128}"/>
@armornick
armornick / uno-bootstrap-preset.ts
Created July 3, 2023 17:21
Uno.css Bootstrap Preset (unfinished)
import { Preset, Rule } from 'unocss'
const displayRules: Rule[] =
['none','inline','inline-block','block','grid','inline-grid','flex','inline-flex','table','table-row','table-cell']
.map(display => [`d-${display}`, { display }]);
const flexDirectionRules: Rule[] =
['row','row-reverse','column','column-reverse']
.map(direction => [`flex-${direction}`, { 'flex-direction': direction }]);
const textAlignRules: Rule[] =
['left','right','center'].map(alignment => [`text-${alignment}`, { 'text-align': alignment }]);
@armornick
armornick / w3css-modernized-2.css
Last active June 9, 2023 12:41
w3.css modernized (version 2)
:root {
/* font families */
--font-body: Verdana,sans-serif;
--font-heading: "Segoe UI",Arial,sans-serif;
/* Colors */
--color-amber: #ffc107;
--color-aqua: #00ffff;
--color-blue: #2196F3;
--color-light-blue: #87CEEB;
--color-brown: #795548;
@armornick
armornick / sdl2mixer.c
Created August 28, 2012 10:40
Using SDL_Mixer with SDL2
#include <SDL2/SDL.h>
#include <SDL2/SDL_mixer.h>
#define WAV_PATH "Roland-GR-1-Trumpet-C5.wav"
#define MUS_PATH "HR2_Friska.ogg"
// Our wave file
Mix_Chunk *wave = NULL;
// Our music file
Mix_Music *music = NULL;
@armornick
armornick / apputils.pas
Created May 10, 2014 09:36
Free Pascal program to make Lazarus portable (based off the earlier batch script but more versatile)
unit AppUtils;
{$mode objfpc}{$H+}
interface
uses
SysUtils;
function CheckDir(path:string):Boolean;
@armornick
armornick / tailwind-variables.css
Last active September 21, 2022 09:49
CSS Variables of Tailwind design tokens
:root {
/* Colors > Slate */
--tw-slate-50: #f8fafc;
--tw-slate-100: #f1f5f9;
--tw-slate-200: #e2e8f0;
--tw-slate-300: #cbd5e1;
--tw-slate-400: #94a3b8;
--tw-slate-500: #64748b;
--tw-slate-600: #475569;
@armornick
armornick / list-cpls.cpp
Created April 12, 2016 18:43
List control panel applets and allow the user to open them
/*
List and load Control Panel applets
Based on this article:
https://blogs.msdn.microsoft.com/oldnewthing/archive/2003/12/26/45979.aspx
And this section of MSDN:
https://msdn.microsoft.com/en-us/library/windows/desktop/cc144185(v=vs.85).aspx
KNOWN BUGS: