nim c --cc:clang --mm:orc --panics:on --threads:on --tlsEmulation:off -l:"-fuse-ld=mold" %f
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
# nsm.nim | |
# A tool to monitor nimsuggest processes and their memory consumption | |
# Created by FOXOMAN @ 2025 | |
import os, osproc, strutils, strformat, parseopt, algorithm, math | |
import terminal | |
type | |
ProcessInfo = object | |
pid: int |
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
# Nim ACME Client for SSL/TLS Certificate Management | |
## A high-performance RFC 8555 compliant ACME client for automated SSL/TLS certificate management | |
## | |
## This package provides a complete API for obtaining, managing, and renewing SSL/TLS certificates | |
## using the ACME protocol (RFC 8555), compatible with Let's Encrypt and other ACME providers. | |
## | |
## Basic usage example: | |
## ```nim | |
## import asyncdispatch | |
## import acme_client |
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
#cc = clang | |
--experimental:strictEffects | |
--experimental:strictFuncs | |
--experimental:strictDefs | |
--experimental:unicodeOperators | |
--experimental:overloadableEnums | |
--define:nimPreviewCstringConversion | |
--define:nimPreviewFloatRoundtrip | |
--define:nimStrictDelete | |
--define:nimUseLinenoise |
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
#!/bin/bash | |
# Set the extension name | |
EXTENSION_NAME="nim" | |
# Set the new version (edit this manually) | |
NEW_VERSION="0.0.2" | |
# Set the original repo URL | |
ORIGINAL_REPO="https://github.com/foxoman/zed-nim" |
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
# Cross-Platform Virtual Memory - Enhanced Security Version | |
## | |
## This module provides cross-platform virtual memory allocation with enhanced security features. | |
## It offers a consistent API across Windows and POSIX systems with additional security checks | |
## and protections against common memory-related vulnerabilities. | |
## | |
## Overview: | |
## - Cross-platform memory management between Windows (VirtualAlloc) and POSIX (mmap) | |
## - Enhanced security against common memory attacks | |
## - Protection against buffer overflows, integer overflows and memory leaks |
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
# ---------------------------------- | |
# Shellcode Execution Utility in Nim | |
# ---------------------------------- | |
# This Nim script is designed to execute a predefined shellcode, | |
# a small piece of low-level code used for various purposes. | |
# In this specific case, the shellcode is a function that performs | |
# hashing of a string. | |
# | |
# The script takes a hardcoded string "Fergo", loads the shellcode | |
# into memory, and then executes the shellcode using this string |
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
type | |
CanDance = concept x | |
dance(x) # `x` is anything that has a `dance` procedure | |
proc doBallet(dancer: CanDance) = | |
# `dancer` can be anything that `CanDance` | |
dance(dancer) | |
# --- |
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
{.passc:"-m32"} | |
{.passl:"-m32"} | |
import winim,os | |
#nim c --cpu:i386 --app:lib --nomain | |
# https://www.appsloveworld.com/csharp/100/446/using-nim-to-generate-a-dll-for-use-in-c-vb6 | |
proc TestFunc(a: cint):cint {.exportc, stdcall, dynlib.} = | |
echo "function called!" | |
a + 5 |
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
import threadpool, tables, strutils | |
const | |
filesArray = ["data1.txt", "data2.txt", "data3.txt"] | |
proc countWords2(filename: string): CountTableRef[string] = | |
result = newCountTable[string]() | |
for word in readFile(filename).splitWhitespace(): | |
result.inc word |
NewerOlder