Skip to content

Instantly share code, notes, and snippets.

@kasajian
kasajian / ValueObject.cs
Last active October 23, 2020 08:29
ValueObject
public class ConnectionString
{
public string Value { get; private set; }
public ConnectionString(string value)
{
Value = value;
}
public static implicit operator string(ConnectionString connectionString)
@kasajian
kasajian / ApprovalTests.cpp
Last active October 23, 2020 08:21
Approval Tests CPP
#include "ApprovalTests.hpp"
#include <iostream>
void TestXyz()
{
try
{
TestName currentTest;
currentTest.setFileName(__FILE__);
currentTest.sections = { "TestXyz" };
@kasajian
kasajian / m3-downloader.bat
Created October 23, 2020 07:18 — forked from a-sync/m3-downloader.bat
m3 archívum URL vagy M3- ill. RADIO- azonosító alapján letölti a műsort youtube-dl segítségével
@if (@a==@b) @end /*
@echo off
setlocal
if "%~1"=="/?" goto usage
if %0 == "%~0" (
title m3-downloader.bat
set /p INPUT="ID/URL: "
) else (
set "INPUT=%~1"
@kasajian
kasajian / embedded_nodejs.bat
Created October 23, 2020 07:09 — forked from a-sync/embedded_nodejs.bat
A single batch file that downloads a nodejs binary and runs the code embedded in itself. (for windows 7 and above)
if ("0"=="1") /*
@echo off
set args=%*
setlocal ENABLEDELAYEDEXPANSION
if not exist %TEMP%\node.exe (
echo DOWNLOADING RUNTIME...
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://nodejs.org/dist/latest/win-x64/node.exe', '%TEMP%\node.exe')"
echo DOWNLOAD COMPLETE!
)
@kasajian
kasajian / desktop ui technologies
Created January 23, 2020 22:03
desktop ui technologies
node:
native:
https://github.com/parro-it/libui-node
web:
https://github.com/GoogleChromeLabs/carlo
c/c++:
native:
https://github.com/andlabs/libui
web:
@kasajian
kasajian / ccom.cpp
Created May 20, 2014 02:48
Creating a COM Object in plain C++
#include <windows.h>
#include "ccom.h"
// In order to use from VBScript, you need to place the progID in the registry so
// that it can be used to obtain the CLSID of this class.
// VB script
/*
DIM X
DIM Y
SET X = CREATEOBJECT( "BrlsMath.Math" )
@kasajian
kasajian / m.c
Created October 5, 2017 20:27
ASCII image of the Mandelbrot set
main (n)
{
float r, i, R, I, b;
for (i = -1; i < 1; i += .06, puts (""))
for (r = -2; I = i, (R = r) < 1; r += .03, putchar (n + 31))
for (n = 0; b = I * I, 26 > n++ && R * R + b < 4;
I = 2 * R * I + i, R = R * R - b + r);
}
@kasajian
kasajian / CSLogger.md
Last active August 23, 2017 21:46
Poor Man's C Sharp Logger

Brain-dead simplistic logger

    var message = ".....";
    System.IO.File.AppendAllText(System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData), "log.txt"), string.Format("{0}\r\n", message));

Then type %localappdata% from the Run dialog to display the folder containing log.txt. Or type %localappdata%\log.txt

A method taking variable number of arguments

private static void Log(string format, params object[] parameters)

@kasajian
kasajian / mp4tomp3.bat
Created July 30, 2015 06:07
Windows cmd to convert mp4 to mp3 (extract audio) using ffmpeg
for %i in (*.mp4) do echo ffmpeg -i "%~ni.mp4" "%~ni.mp3"
@kasajian
kasajian / tryWinJs.html
Created January 8, 2016 20:03
WinJS Example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>tryWinJs</title>
<link href="winjs/css/ui-light.min.css" rel="stylesheet" />
<script src="winjs/js/base.min.js"></script>
<script src="winjs/js/ui.min.js"></script>
<style>
body{