Skip to content

Instantly share code, notes, and snippets.

@mwiemarc
mwiemarc / decode_text_hex.lua
Created November 5, 2019 11:19
decode text from hexvalues (in colors)
local str =
'8BC337C54C327C337C338C54C329C323C327C332C54C93C323C326C323C327C32BC332C327C337C66C54C322CB9C337C337C54C322CB9C337C54C99CB9C336C329C323C332C344C323C327CBBC326C323C332C54C322C323C336C54C8AC323C324C327CB9C337CBACB9C332C322C323C54C327C326C336C323C54C336C333C338C323C332C54C97C333C334C324C338C3B713AACBBC326C323C336C54C337C327C332C322C68C54C87CBAC323C336C54C33BC327C336C54C326CB9CBAC323C332C54C326C323C336CB9C339C337C325C323C324C339C332C322C323C332C66C54C322CB9C337C337C54C322CB9C337C54C99CB9C338C323C336C327CB9C32AC66C54CB9C339C337C54C322C323C32BC54C322C327C323C337C323C54C97C333C334C324C338C3B713AACBBC326C323C336C54C325C323C32BCB9CBBC326C338C54C337C327C332C322C66C54C322C323C332C54CA4CB9C332C325C54C322C323C337C54C88CB9C332C322C323C332C32BC327C338C325C32AC327C323C322C337C54CBAC323C344C323C327CBBC326C332C323C338C68C54C96C323C338C344C338C66C54C33BC333C54C33BC327C336C54C322CB9C337C54C33BC327C337C337C323C332C66C54C32BC3B713A4CBBC326C338C323C54C327CBBC326C66C54C322CB9C337C337C54C95C326C336C54C337C333C54C33AC3
@mwiemarc
mwiemarc / decode_text_hex.lua
Created November 5, 2019 11:19
decode text from hexvalues (in colors)
local str =
'8BC337C54C327C337C338C54C329C323C327C332C54C93C323C326C323C327C32BC332C327C337C66C54C322CB9C337C337C54C322CB9C337C54C99CB9C336C329C323C332C344C323C327CBBC326C323C332C54C322C323C336C54C8AC323C324C327CB9C337CBACB9C332C322C323C54C327C326C336C323C54C336C333C338C323C332C54C97C333C334C324C338C3B713AACBBC326C323C336C54C337C327C332C322C68C54C87CBAC323C336C54C33BC327C336C54C326CB9CBAC323C332C54C326C323C336CB9C339C337C325C323C324C339C332C322C323C332C66C54C322CB9C337C337C54C322CB9C337C54C99CB9C338C323C336C327CB9C32AC66C54CB9C339C337C54C322C323C32BC54C322C327C323C337C323C54C97C333C334C324C338C3B713AACBBC326C323C336C54C325C323C32BCB9CBBC326C338C54C337C327C332C322C66C54C322C323C332C54CA4CB9C332C325C54C322C323C337C54C88CB9C332C322C323C332C32BC327C338C325C32AC327C323C322C337C54CBAC323C344C323C327CBBC326C332C323C338C68C54C96C323C338C344C338C66C54C33BC333C54C33BC327C336C54C322CB9C337C54C33BC327C337C337C323C332C66C54C32BC3B713A4CBBC326C338C323C54C327CBBC326C66C54C322CB9C337C337C54C95C326C336C54C337C333C54C33AC3
@mwiemarc
mwiemarc / encode_text_hex.lua
Created November 5, 2019 11:18
encode text into hex values to display as colors
local str =
'Es ist kein Geheimnis, dass das Markenzeichen der Defiasbande ihre roten Kopftücher sind. Aber wir haben herausgefunden, dass das Material, aus dem diese Kopftücher gemacht sind, den Rang des Bandenmitglieds bezeichnet. Jetzt, wo wir das wissen, möchte ich, dass Ihr so viele hochrangige Mitglieder der Defias eliminiert, wie Ihr könnt. Die Bandenmitglieder mit der höchsten Position findet Ihr zweifellos in van Cleefs Geheimversteck. Wenn Ihr fertig seid, bringt mir 10 rote Seidenkopftücher zum Beweis, dass sie tot sind, dann werde ich Euch belohnen. Viel Glück, <Name>.'
local byteStr = ''
for c in str:gmatch('[\0-\x7F\xC2-\xF4][\x80-\xBF]*') do
local b1, b2, b3, b4 = c:byte(1, -1) -- get all bytes for that character
local charStr
-- add bytes to string
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))
SAC.DialogFrame = CreateFrame('Frame', SAC_AddonName .. 'DialogFrame')
SAC.DialogFrame:SetBackdrop(
{
bgFile = 'Interface\\DialogFrame\\UI-DialogBox-Background',
edgeFile = 'Interface\\DialogFrame\\UI-DialogBox-Border',
tile = 1,
tileSize = 32,
edgeSize = 32,
insets = {left = 11, right = 12, top = 12, bottom = 11}
}
@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))
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway:400,300,600">
<link rel="stylesheet" href="https://cdn.rawgit.com/necolas/normalize.css/master/normalize.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.min.css">
<title>ESP Light Control</title>
@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;
@mwiemarc
mwiemarc / RGB-Hex.js
Created July 22, 2018 14:22 — forked from Arahnoid/RGB-Hex.js
Bunch of RGB to Hex and Hex to RGB convert javascript functions what works well in Photoshop
///////////////////////////////////////////////////////////////////////////////////
/// Colection of RGB to HSB, HSB to RGB convert functions
/// Source: http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb
///////////////////////////////////////////////////////////////////////////////////
/**
* componentToHex convert two digit htx value to R, G or B chanel value
* @param number c value from 0 to 225
* @return string value of R, G or B chanel
* @usage //alert (componentToHex(255)); //ff