Skip to content

Instantly share code, notes, and snippets.

View X39's full-sized avatar
:octocat:
Busy with reallife

Marco Silipo X39

:octocat:
Busy with reallife
View GitHub Profile
@X39
X39 / xml_fnc_parse.sqf
Created October 15, 2019 15:49
XML Parser
////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2019 Marco "X39" Silipo //
// //
// Permission is hereby granted, free of charge, to any person obtaining //
// a copy of this software and associated documentation files (the //
// "Software"), to deal in the Software without restriction, including //
// without limitation the rights to use, copy, modify, merge, publish, //
// distribute, sublicense, and/or sell copies of the Software, and to //
// permit persons to whom the Software is furnished to do so, subject to //
// the following conditions: //
@X39
X39 / Promise.sqf
Last active December 13, 2018 22:09
Promise system for SQF
////////////////////////////////////////////////////////////////////////////////////
// MIT License //
// //
// Copyright (c) 2018 Marco Silipo (X39) //
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy //
// of this software and associated documentation files (the "Software"), to deal //
// in the Software without restriction, including without limitation the rights //
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell //
// copies of the Software, and to permit persons to whom the Software is //
@X39
X39 / Attached.tt
Created March 22, 2018 19:38
T4 Template for AttachedProperties to wpf control events (UIControl, FrameworkElement and Control)
<#@ template debug="true" hostspecific="false" language="C#" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="PresentationCore" #>
<#@ assembly name="PresentationFramework" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Windows" #>
<#@ import namespace="System.Windows.Controls" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".cs" #>
@X39
X39 / sao.sqf
Created September 29, 2017 00:43
show allmission objects
if (!isNil "eh") then {removeMissionEventHandler ["Draw3D", eh];};
eh = addMissionEventHandler["Draw3D", {
{
private _pos = position _x;
drawLine3D [[(_pos select 0) - 1, (_pos select 1) - 1, (_pos select 2) - 1], [(_pos select 0) - 1, (_pos select 1) + 1, (_pos select 2) - 1], [1, 0, 0, 1]];
drawLine3D [[(_pos select 0) - 1, (_pos select 1) - 1, (_pos select 2) - 1], [(_pos select 0) - 1, (_pos select 1) - 1, (_pos select 2) + 1], [1, 0, 0, 1]];
drawLine3D [[(_pos select 0) - 1, (_pos select 1) - 1, (_pos select 2) - 1], [(_pos select 0) + 1, (_pos select 1) - 1, (_pos select 2) - 1], [1, 0, 0, 1]];
drawLine3D [[(_pos select 0) + 1, (_pos select 1) + 1, (_pos select 2) + 1], [(_pos select 0) + 1, (_pos select 1) - 1, (_pos select 2) + 1], [1, 0, 0, 1]];
drawLine3D [[(_pos select 0) + 1, (_pos select 1) + 1, (_pos select 2) + 1], [(_pos select 0) - 1, (_pos select 1) + 1, (_pos select 2) + 1], [1, 0, 0, 1]];
@X39
X39 / quiz.html
Created August 16, 2017 13:15
Quiz html "draft"
<html>
<head>
<style>
body {
}
.quiz {
width: 75%;
text-align: center;
margin: auto;
background: #929292;
@X39
X39 / code.sqf
Created April 29, 2016 14:59
ArmA3 Draw Player Markers on HUD
if (!isNil "EH") then
{
removeMissionEventHandler ["Draw3D", EH];
};
EH = addMissionEventHandler ["Draw3D", {
_prefix = "_USER_DEFINED";
_prefixCount = count _prefix;
_cfgMarkers = configFile >> "CfgMarkers";
_cfgMarkerColors = configFile >> "CfgMarkerColors";
_FadeDistanceMax = [2000, 3000];
X39_fnc_genMissionUUID = {
///Generates a numbers only UUID
///Chance for duplicates is extremly low but not 100% terminated!
///Chance for duplicates can be further reduced by taking player
///UID into account (will prevent usage for servers)
private [
"_fnc_toNDigitsStringRandom",
"_parts"
];
_fnc_toNDigitsStringRandom = {
@X39
X39 / ExtractCfgToClipboard.sqf
Last active October 4, 2015 10:13
Prints ArmA Config class (+ its parents) to clipboard
//Example call:
//[configFile >> "CfgVehicles" >> "B_Soldier_F"] call _fnc_printClass;
_fnc_printClass = {
params [
"_class"
];
private [
"_fnc_getClass",
"_fnc_WriteToString",
"_classArr",
X39_fnc_Scheduler_Create = {
/*
* Creates the scheduler object if not yet was created
* Params: -/-
* Return: OBJECT - Scheduler object (also available via missionNamespace variable 'X39_var_Scheduler')
* Throws: No
* Notes : -/-
*/
if(!isNil "X39_var_Scheduler") exitWith {};
private "_scheduleFunction";
@X39
X39 / mutexExtensionDll.cpp
Created August 1, 2015 20:41
ArmA3 Mutex extension
#pragma once
#include <Windows.h>
#include <vector>
#include <mutex>
extern "C"
{
__declspec(dllexport) void __stdcall RVExtension(char *output, int outputSize, const char *function);
};
std::vector<std::mutex*> mutexList;