Este texto é inspirado em A Half Hour to Learn Rust.
This file contains hidden or 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
| // Use in a .NET console project | |
| // Set <PublishAot>true</PublishAot> and <AllowUnsafeBlocks>true</AllowUnsafeBlocks> in the .csproj | |
| // Run dotnet publish | |
| // Create service: sc create MyService binPath= "C:\full\path\to\Release\net9.0\win-x64\publish\WatchTemp.exe" | |
| using System.Runtime.CompilerServices; | |
| using System.Runtime.InteropServices; | |
| class Service : IDisposable | |
| { |
This file contains hidden or 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
| -- Read the docs: https://www.lunarvim.org/docs/configuration | |
| -- Video Tutorials: https://www.youtube.com/watch?v=sFA9kX-Ud_c&list=PLhoH5vyxr6QqGu0i7tt_XoVK9v-KvZ3m6 | |
| -- Forum: https://www.reddit.com/r/lunarvim/ | |
| -- Discord: https://discord.com/invite/Xb9B4Ny | |
| local dap = require("dap") | |
| lvim.plugins = { | |
| { | |
| "catppuccin/nvim", | |
| name = "catppuccin" |
This file contains hidden or 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 <windows.h> | |
| #include <winternl.h> | |
| #define dwAllowDllCount 1 | |
| CHAR cAllowDlls[dwAllowDllCount][MAX_PATH] = { | |
| "W:\\allowed.dll" | |
| }; | |
| VOID HookLoadDll(LPVOID lpAddr); |
This file contains hidden or 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.Diagnostics; | |
| public static class CpuTotalPc | |
| { | |
| private static PerformanceCounter _CPUsage; | |
| public static double CPULoad | |
| { | |
| get | |
| { | |
| if (_CPUsage == null) | |
| try |
This file contains hidden or 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
| /* | |
| ================================ Compile as a .Net DLL ============================== | |
| C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /target:library /out:TestAssembly.dll TestAssembly.cs | |
| */ | |
| using System.Windows.Forms; | |
| namespace TestNamespace |
This file contains hidden or 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 static string StripHTMLAll(string source) | |
| { | |
| try | |
| { | |
| string result; | |
| result = source.Replace("\r", " "); | |
| result = result.Replace("\n", " "); | |
| result = result.Replace("\t", " "); | |
| result = Regex.Replace(result, @"( )+", " ", RegexOptions.IgnoreCase); | |
| result = Regex.Replace(result, @"<( )*head([^>])*>", "<head>", RegexOptions.IgnoreCase); |
This file contains hidden or 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 SmartI | |
| { | |
| private readonly Dictionary<int, Smart> _smartInfo = new Dictionary<int, Smart>(); | |
| public readonly HashSet<int> FutureReserchUnknownAttributes = new HashSet<int>(); | |
| private static bool Is64Bit => IntPtr.Size == 8; | |
| private static uint OffsetSize => Is64Bit ? 8u : 6u; | |
| public Dictionary<int, Smart> SmartInfo | |
| { | |
| get | |
| { |
This file contains hidden or 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 "stdafx.h" | |
| int main() | |
| { | |
| ICLRMetaHost *metaHost = NULL; | |
| IEnumUnknown *runtime = NULL; | |
| ICLRRuntimeInfo *runtimeInfo = NULL; | |
| ICLRRuntimeHost *runtimeHost = NULL; | |
| IUnknown *enumRuntime = NULL; | |
| LPWSTR frameworkName = NULL; |
This file contains hidden or 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 static class Option | |
| { | |
| public static Option<T> None<T>() => new None<T>(); | |
| public static Option<T> Some<T>(T value) => new Some<T>(value); | |
| } | |
| public class Option<T> : IEquatable<Option<T>> | |
| { | |
| public static Option<T> None => new None<T>(); | |
| public bool IsNone => !hasValue; |
NewerOlder