This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GetScreenshot{ | |
public static BitmapSource GetScreen(Rectangle coordinates) { | |
int left = coordinates.Left; | |
int top = coordinates.Top; | |
int width = coordinates.Width; | |
int height = coordinates.Height; | |
using(var screenBmp = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)) { | |
using(var bmpGraphics = Graphics.FromImage(screenBmp)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System; | |
using System.Threading; | |
using System.Linq; | |
[ExecuteInEditMode] | |
/// <summary> | |
/// Multithreading support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unknwn.h> | |
void wmain(int argc, wchar_t* argv[]) | |
{ | |
GUID guid; | |
wchar_t wzGuid[39] = { 0 }; | |
int count = (1 < argc) ? _wtoi(argv[1]) : 1; | |
for (int i = 0; i < count; ++i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Console Colors (Green, NoColor) | |
GREEN='\033[0;32m' | |
NC='\033[0m' | |
# GitHub Username | |
User="mrousavy" | |
# Get Repo Var | |
printf "Repo Name: ${GREEN}$User/" | |
read repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Console Colors (Green, NoColor) | |
GREEN='\033[0;32m' | |
NC='\033[0m' | |
# Loop over all Directories | |
for path in *; do | |
[ -d "${path}" ] || continue # if not a directory, skip | |
dirname="$(basename "${path}")" | |
cd $dirname # Go into Directory | |
printf "${GREEN}$dirname: ${NC}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Load all references/namespaces that can be found in this assembly (excluding own references) | |
/// </summary> | |
public static string[] LoadReferences() | |
{ | |
//Get all namespaces from this assembly (own project, own library, ..) | |
IEnumerable<string> ownNamespaces = Assembly.GetExecutingAssembly().GetTypes() | |
.Select(t => t.Namespace) | |
.Distinct(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading.Tasks; | |
using System.Windows; | |
using System.Windows.Media.Animation; | |
namespace mrousavy { | |
public static class AnimationExtensions { | |
/// <summary> | |
/// Animate a given <see cref="UIElement" />/<see cref="System.Windows.Controls.Control" /> asynchronous (awaitable) | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<SyntaxDefinition name="CSharp" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008"> | |
<Color name="CommentSingle" foreground="#0cad31" /> | |
<Color name="CommentMulti" foreground="#068724" /> | |
<Color name="String" foreground="Orange" /> | |
<Color name="Char" foreground="DarkOrange" /> | |
<Color name="Digits" foreground="DarkBlue"/> | |
<RuleSet> | |
<Span color="CommentSingle" begin="//" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Windows.Input; | |
public class RelayCommand : ICommand { | |
private readonly Predicate<object> _canExecute; | |
private readonly Action<object> _execute; | |
public RelayCommand(Action<object> execute, Predicate<object> canExecute = null) { | |
_execute = execute ?? throw new ArgumentNullException(nameof(execute)); | |
_canExecute = canExecute ?? (o => true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <stdio.h> | |
#include <fstream> | |
#include <stdint.h> | |
inline uint32_t read_big_int(std::fstream &fileStream) { | |
unsigned char bytes[4]; | |
fileStream.read((char*)bytes, 4); | |
return (uint32_t)((bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3]); |
OlderNewer