Skip to content

Instantly share code, notes, and snippets.

@mwiemarc
mwiemarc / ColorConsole.cs
Created January 21, 2021 09:31 — forked from RickStrahl/ColorConsole.cs
Color Console - a simple class to add color to .NET Console commands more easily.
using System;
using System.Text;
using System.Text.RegularExpressions;
namespace MainColorConsole
{
class Program
{
static void Main(string[] args)
{
@mwiemarc
mwiemarc / flappy.html
Created November 30, 2020 09:20 — forked from gullyn/flappy.html
Flappy bird in 228 bytes (improved!)
<body onload="z=c.getContext`2d`,p=Y=Q=',9|z.fillRect(',setInterval(`c.height=W=300,p?Y<W&&Y>P&Y<P+E|p>9?z.fillText(S++,0${Q}0,Y-=M-=.5,9${Q}p-=8,0${Q}p,P+E,9,W),P))):(p=M=S=0,Y=E=99):(p=W+4,P=S%E)`,24)"onclick=M=9><canvas id=c>
@mwiemarc
mwiemarc / background.js
Created October 3, 2020 22:41 — forked from danharper/background.js
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@mwiemarc
mwiemarc / custom_game_engines_small_study.md
Created June 30, 2020 12:42 — forked from raysan5/custom_game_engines_small_study.md
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) because d

@mwiemarc
mwiemarc / foo.sh
Last active February 28, 2020 15:28 — forked from drmalex07/README-create-debian-startup-script.md
An example of how to create a init.d script in Debian, using dependency booting. #debian #init.d #lsb-script #startup-script
#! /bin/bash
### BEGIN INIT INFO
# Provides: foo
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: foo service
# Description: Run Foo service
@mwiemarc
mwiemarc / Base64.lua
Created November 6, 2019 01:06 — forked from bortels/Base64.lua
Base64 encode/decode for Codea (Lua)
-- Lua 5.1+ base64 v3.0 (c) 2009 by Alex Kloss <[email protected]>
-- licensed under the terms of the LGPL2
-- character table string
local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
-- encoding
function enc(data)
return ((data:gsub('.', function(x)
local r,b='',x:byte()
function string.fromhex(str)
return (str:gsub('..', function (cc)
return string.char(tonumber(cc, 16))
end))
end
function string.tohex(str)
return (str:gsub('.', function (c)
return string.format('%02X', string.byte(c))
end))
@mwiemarc
mwiemarc / After.lua
Created November 4, 2019 08:49 — forked from jnwhiteh/After.lua
An example addon showing a simple frame in XML used in Lua
print("After the XML is loaded", FrameTestFrame)
local seconds = 10
local total = 0
FrameTestFrame:SetScript("OnUpdate", function(self, elapsed)
total = total + elapsed
if total > seconds then
self:SetScript("OnUpdate", nil)
end
local sides = 100 + (100 * (total / seconds))
@mwiemarc
mwiemarc / ffmpeg.md
Created August 4, 2018 00:36 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@mwiemarc
mwiemarc / iconextractor.cs
Created July 29, 2018 11:46 — forked from jbasinger/iconextractor.cs
Icon Extraction in Windows using NodeJS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using System.Drawing;
using System.IO;
using Newtonsoft.Json;