Help - Using Nim In The Kitchen

2020-08-03 Thread Cnerd
Well you could checkout jester [https://www.google.com/url?sa=t&source=web&rct=j&url=https://github.com/dom96/jester&ved=2ahUKEwjE1uPmpv_qAhVGXBoKHYuuDqcQFjAAegQIAxAC&usg=AOvVaw0j6MD1xq_GIGEEDW2anjgd](https://www.google.com/url?sa=t&source=web&rct=j&url=https://github.com/dom96/jester&ved=2ahUKEwj

Help - Using Nim In The Kitchen

2020-08-03 Thread Cnerd
And I've checked your image and the interface of the website depends on how good you are at CSS or what type of CSS bootstrap you use

Help - Using Nim In The Kitchen

2020-08-03 Thread Cnerd
Yes too much JavaScript can affect a site's SEO ratings especially if it is difficult to crawl the site. The reason there are no html files in the forum source code is because jester mainly uses template files. Reference the nim in action book on how to use jester

Nim beginner series for absolute beginners

2020-08-08 Thread Cnerd
Hello guy made a beginner series for Nim you can check it out here [https://www.youtube.com/playlist?list=PLUG1iyu04pAmudSymMOb-cfB8AoK5UHpi](https://www.youtube.com/playlist?list=PLUG1iyu04pAmudSymMOb-cfB8AoK5UHpi) now I won't pretend to be a great YouTuber (video audio quality is poor) and I k

Nim beginner series for absolute beginners

2020-08-08 Thread Cnerd
Thanks for the feedback. When I say absolute beginner I mean someone who is new to coding in general and one who finds jumping directly into programming concepts such as strings, ints, types etc difficult or incomprehensible or people who are new to coding in general but have little experience i

Nim beginner series for absolute beginners

2020-08-08 Thread Cnerd
But you can use the site instead

Nim beginner series for absolute beginners

2020-08-08 Thread Cnerd
I am really sorry about that couldn't get a good mic for the tutorial

Nim website front page redesign (unofficial and WIP)

2020-08-08 Thread Cnerd
@doongjohn it's really cool👍🏾👍🏾 but I think it will look nicer with darker colors😉

Nim beginner series for absolute beginners

2020-08-09 Thread Cnerd
@douglas thanks for the feedback really appreciate the next videos will have a better audio setup than the previous ones that I promise

Nim - Julia bridge

2020-08-24 Thread Cnerd
Sorry to point this out but Nim can already function as a scripting language and yes nimscript does not support all of Nim functionalities and some of the modules in the stdlib but wouldn't it just be better and less stressful to develop more on nimscript

Karax : convert html string to vdom

2021-11-03 Thread Cnerd
Hello, I have been working on a webapp which uses karax on the frontend. I want to know if there is a karax procedure which can covert html text to karax vdom. If there no procedure that can achieve that, is there a certain workflow which is not computation intensive and is not bad code design t

Karax : convert html string to vdom

2021-11-03 Thread Cnerd
Thank you s much, really appreciate it.

Karax : convert html string to vdom

2021-11-04 Thread Cnerd
Thanks 👍🏾

Karax : convert html string to vdom

2021-11-05 Thread Cnerd
Hi so after some thought i have created a library called htmlToVdom which converts html string to embbedable karax representations. I have tested it and it works well. So if you ever need the library here's the link to the github page . I have also made a p

Httpbeast failed to compile on Android arm device

2021-12-10 Thread Cnerd
My jester code which compiles on my laptop has failed to compile on my android phone inside termux. Here is the error code Nim gave /data/data/com.termux/files/home/.nimble/pkgs/httpbeast-0.2.2/httpbeast.nim(282, 17) Error: undeclared identifier: 'addTimer' candidates (edit di

Httpbeast failed to compile on Android arm device

2021-12-13 Thread Cnerd
Actually it's the latest version of nim ~ $ nim -v Nim Compiler Version 1.6.0 [Android: arm] Compiled at 2021-10-19 Copyright (c) 2006-2021 by Andreas Rumpf git hash: 727c6378d2464090564dbcd9bc8b9ac648467e38 active boot switches: -d:release -d:danger

Httpbeast failed to compile on Android arm device

2021-12-13 Thread Cnerd
I just tried cross compilation on my laptop using nimble build --gc:orc --cpu:arm --os:android --d:ssl --threads:on Run And i got the same output

Httpbeast failed to compile on Android arm device

2021-12-13 Thread Cnerd
Ok, thanks for the help i really appreciate it 👍🏾

Nim smtp library

2021-12-24 Thread Cnerd
Hello, I have been using the smtp library lately and i noticed that it does not natively support html emails. So i did so research myself and in short i ended up adding some headers to the smtp request. The html mail gets sent but some html tags are not rendered like img, svg and a tags, so does

html2karax first release!

2022-01-29 Thread Cnerd
Nice 👍🏾. I also made a library like this a while back although mine is [htmltoVdom](https://github.com/C-NERD/htmlToVdom)

Catch exceptions without crashing app

2022-02-21 Thread Cnerd
Jester has a feature in which it catches exceptions of code without crashing the web application. How is this feature implemented. I have used the usual try and except for the proc and although it caught the exception the program still crashes.

Catch exceptions without crashing app

2022-02-21 Thread Cnerd
I wrapped the procedure in a template template safeRunning(action : untyped) = try: action except Exception as e: error(e.msg) Run then i called it here safeRunning:

Catch exceptions without crashing app

2022-02-21 Thread Cnerd
I really can't find any part of the code that would be minimal enough to be tested. But i can give a example of an error i got which crashed the app although i have fixed it now. The was a value error which occured when i used parseFloat on a string(runtime error of course)

Catch exceptions without crashing app

2022-02-21 Thread Cnerd
That is the main problem

Catch exceptions without crashing app

2022-02-22 Thread Cnerd
Ok i'll try that. thanks

My nooby questions on nim-web3 library

2022-04-26 Thread Cnerd
Hello 👋, I plan on executing a personal project and I need some information before I start. I have googling for over a week now and some of my questions are still left unanswered that's why I want to ask folks on this forum, any contribution is very much appreciated. Here are my questions * h

My nooby questions on nim-web3 library

2022-04-28 Thread Cnerd
Thanks for the clarification

My nooby questions on nim-web3 library

2022-04-29 Thread Cnerd
Hi one more question if you don't mind. Is it possible to get all data on a nft from just the transaction hash of a transaction the nft was involved in, and if so can you give an example of how it can be done. I saw a example on the web but there were some part of the code I don't understand lik

Weird behaviour from fmt in strformat library

2022-05-10 Thread Cnerd
When is substitute fmt for format from the strutils library it works well. I think the problem is from the way the fmt macro builds code. maybe it's ignoring the attempts variable while building the code

Weird behaviour from fmt in strformat library

2022-05-10 Thread Cnerd
ng again...") attempts.inc() continue fatal(fmt"Request TIMEOUT after {attempts} attempts, quitting..") ## This line gives an error quit(-1) Run The error : /home/cnerd/Documents/Pentesting/twitterapi/src/tw

Weird behaviour from fmt in strformat library

2022-05-10 Thread Cnerd
The variable attempts which the compiler claims is undefined is not part of the template arguments. it's a local variable declared inside of the template. So that limitation does not apply to this block of code

Weird behaviour from fmt in strformat library

2022-05-10 Thread Cnerd
The inject pragma works, thanks @DavideGalilei and @Yardanico. By the way is this specific to variables or does it also affects let and consts

Karax VNode.add question

2022-06-11 Thread Cnerd
Dom did not get updated when I used karax add to add vnode. I used kout to print out the vnode and found out that the vnode has been updated but the Dom is still the same. I also called redraw() after adding the vnode but still no luck

Jester disable content-length header

2022-06-14 Thread Cnerd
Hello I am using jester to build a proxy and the proxy is meant to return headers and the response content. The problem is that the response already contains an header "content-length" but jester still adds this header to the proxies response even after I have initially added the header. So is t

Jester disable content-length header

2022-06-14 Thread Cnerd
Ok I'll try that, thanks

SMTP - 503 Bad sequence of commands with std/smtp

2022-06-20 Thread Cnerd
well from this article i found on google [article](https://hostpapasupport.com/error-503-valid-rcpt-command-must-precede-data-apple-mail/#:~:text=The%20%E2%80%9CError%20503%3A%20Valid%20RCPT,authenticated%20by%20your%20email%20server.) it says that smtp error 503 is caused by 2 things * The fi

Nim smtp library

2022-06-20 Thread Cnerd
For anyone still having problems sending html using the smtp library here is a code snippet to help you out import smtp, htmlgen let smtpConn = newSmtp(useSsl = true, debug=true) body = html( body( p("Hello there just testing out t

Implement api rate limiting with jester

2022-07-23 Thread Cnerd
Hello i am attempting to implement rate limiting on my jester server application and to do that i created a variable of type `OrderedTable` which would keep track of the ip address of all computers requesting from the server and would stop serving to theses computers if they exceed a certain lim

Implement api rate limiting with jester

2022-07-23 Thread Cnerd
Thanks I think I will switch my project's server to prologue

Implement api rate limiting with jester

2022-07-25 Thread Cnerd
Also it'll be nice if we could get a full documentation of the jester routes macros without having to read the code

Implement api rate limiting with jester

2022-07-25 Thread Cnerd
Ok, thanks. For some reason Nim doc failed to generate proper docs on the routes macro in general it doesn't usually generate proper docs for macros so I couldn't find this in the jester docs.

let variable is not gc safe

2022-07-28 Thread Cnerd
I have these let variables from os import getEnv from strutils import parseInt, isEmptyOrWhitespace let SERVER_HOST* : string = block : var host : string = "localhost" ## default host localhost let env_host = getEnv("H

let variable is not gc safe

2022-07-28 Thread Cnerd
So after going through the nim manual i found out that you can overide the compilers gc safe analysis to assign non gc safe variables to local proc variables like so {.cast(gcsafe).}: let SERVER_HOST = SERVER_HOST SERVER_PORT = SERVER_PORT

Ormin postgres backend with threads

2022-08-01 Thread Cnerd
Hello can anyone provide an example of calling a proc which uses postgresql backend of the ormin library in a threaded proc.

Implement api rate limiting with jester

2022-09-03 Thread Cnerd
For anyone trying to implement rate limiting with jester, I just created a jester plugin library [clown_limiter](https://github.com/C-NERD/clown_limiter) which can be used to implement rate limiting. I have published the library to nimble just waiting for the pull request to be merged and the li

Nimbus-eth2 beacon node setup

2022-10-02 Thread Cnerd
I am trying to run nimbus as a beacon node consensus client with geth as the execution client. And geth has synchronized with the mainnet to the point of merge and needs a consensus client to guide it through merge synchronization. [10-02|11:40:47.999] Post-merge network, but no be

What is a RollingFileLogger

2022-12-26 Thread Cnerd
>From what I understand of log rotation it's just that the logger will >periodically check the log file size and will make sure that the log file does >not exceed a certain file limit by pruning the log file if it gets too big

Default orc crash simple jester httpbeast

2022-12-27 Thread Cnerd
The crash is not because of orc. It's from trying to access a ref or pointer object that is nil. The problem is probably in your database code. You can tell the os to avoid the error by importing std / segfault in the file causing the segfault error

Default orc crash simple jester httpbeast

2022-12-27 Thread Cnerd
Also you can try using the not nil pragma to make sure that your procedures do not return a nil value

File logging in a thread using spawn (GC safe call expression)

2023-01-26 Thread Cnerd
Like so import std / [locks, logging, exitprocs, threadpool] from std / sugar import `=>` var loggerLock : Lock let logger {.guard : loggerLock.} = newFileLogger("logfile.log.txt") initLock(loggerLock) addExitProc(() {.closure.} => ( deinitLock(lo

File logging in a thread using spawn (GC safe call expression)

2023-01-26 Thread Cnerd
Or you can just use locks on your file logger and use `{.cast[gcsafe].}` to tell the compiler not to worry about gcsafety

Time compare with now

2023-02-03 Thread Cnerd
Well what errors are you getting?

Who wants to do a GSoC about FreeCAD? Program in Nim!

2023-02-13 Thread Cnerd
I am interested in this GSoC, send the link to sign up.

Http request using mom's JavaScript backend

2020-12-30 Thread Cnerd
Hi guys a simple question here can you make an http request using the nim is backend , like leveraging JavaScript fetch api or something and if it is possible please show an example thanks.

Http request using mom's JavaScript backend

2020-12-30 Thread Cnerd
Thanks i just implemented it using the fetch api

Http request using mom's JavaScript backend

2020-12-30 Thread Cnerd
By the way I would really appreciate a sample of code showing the usage of kajax thanks once more

"This Month With Nim"- A Community Showcase

2021-01-15 Thread Cnerd
Beef where can we submit the projects

Search engine for free assets

2021-03-23 Thread Cnerd
Some time ago I made a search engine to get free animation and game assets on the web but, my server subscription will soon run out hence I am making the project open sourced. Here is the link . I'll drop updates to the project from time to time your P

Bundling libraries with executables

2021-05-31 Thread Cnerd
Hi I have a Nim program I want to bundle with the glib2 library is there a way to do this

Bundling libraries with executables

2021-06-02 Thread Cnerd
Thanks

Wrapping cpp code

2021-08-17 Thread Cnerd
Hello i was using c2nim to try to convert a group of header files to nim but some code where omitted. Now this is not to much of a problem because i was able to fix most of them on my own. But i am no expert in c or cpp so there are some lines of code i could not convert because i do not underst

Wrapping cpp code

2021-08-17 Thread Cnerd
Thanks

Background tasks in jester

2023-03-24 Thread Cnerd
All jester endpoints have a result variable. I have forgotten the type of the result variable but it's in the jester docs. You can modify this result variable and the data will appear in the after handler

Background tasks in jester

2023-03-24 Thread Cnerd
I just checked jester's docs. The result variable type is   ResponseData* = tuple[ action: CallbackAction, code: HttpCode, headers: ResponseHeaders, content: string, matched: bool   ] Run

Background tasks in jester

2023-03-25 Thread Cnerd
You can always make a pull request to the jester repo. Although I think you should discuss with @dom first

Ed25519 signing for nim

2023-04-29 Thread Cnerd
Hello, I am trying to implement an aptos library for nim. And, I want to implement code to sign transactions. The aptos blockchain makes use of Ed25519 signatures to sign it's transactions, and I want to know if there is a nim library which already implements this.

Replicate python code in nim

2023-05-21 Thread Cnerd
Hello, I have this python code i want to replicate in nim def bytes_to_clamped_scalar(s): # Ed25519 private keys clamp the scalar to ensure two things: # 1: integer value is in L/2 .. L, to avoid small-logarithm # non-wraparaound # 2: low-order

Replicate python code in nim

2023-05-21 Thread Cnerd
Thanks, this is exactly what I need

Replicate python code in nim

2023-05-21 Thread Cnerd
't use your code in production, the scalar you are processing is a cryptographic private key and issues in your code may expose you to identity theft, losing money (by someone pretending to be you), remote SSH access and what not. Run I am not very experienced in cryptography. But

Replicate python code in nim

2023-05-21 Thread Cnerd
I am aware of the Nim libsodium wrapper, the thing is a I am building the library from the ground up to be able to work for all of nim's backends. Including JavaScript. The bare minimum I need to make this work is to at least be able to generate the public and private keys for transaction signin

Replicate python code in nim

2023-05-21 Thread Cnerd
Thanks, I appreciate your response. I'll definitely go with libsodium for the time being. I'll also keep testing libp2p and improve my understanding on cryptography. Thanks again.

How to prevent nim language server plugin from spawning multiple instances of nimsuggest

2023-08-08 Thread Cnerd
Hello, I am using the nim language server plugin on nvim as lsp server. And, I noticed that it spawns multiple instances of nimsuggest for every nim, nimble or nims file I open. I have tried adding a `projectPath` = "./" In the config file but that still doesn't work. Is there any way I can fix

How to prevent nim language server plugin from spawning multiple instances of nimsuggest

2023-08-08 Thread Cnerd
Ok thanks, I'll switch to nimlsp and see if it's any better

Neo vim config for nim

2023-08-13 Thread Cnerd
Any one with a neo vim config that supports code highlighting and nim lsp with no conflict between the two should please share dot files. Thanks in advance

Neo vim config for nim

2023-08-13 Thread Cnerd
Thanks. I also use `alaviss/nim.nvim` and `nim_languageserver` | `nimlsp` (tested both). I found out that `alaviss/nim.nvim` becomes irresponsive when using these lsp server plugins and upon further investigation I got to know that `alaviss/nim.nvim` also calls `nimsuggest` (or I think it calls

nimBcs

2023-08-16 Thread Cnerd
Introducing nimBcs a pure nim implementation of binary canonical serialization. I initially made this library for the nim Aptos library I was working on, but now it's it own thing. I have tested the library along side the rust implementation and everything seems to work well. But I'll appreciate

Ssl with asynchttpserver

2023-08-19 Thread Cnerd
Run And here is an error given by a nim program that uses the proxy /home/cnerd/test.nim(5) test /home/cnerd/.choosenim/toolchains/nim-2.0.0/lib/pure/httpclient.nim(1224) getContent /home/cnerd/.choosenim/toolchains/nim-2.0.0/lib/pure/httpclient.nim(1219) get /h

Ssl with asynchttpserver

2023-08-19 Thread Cnerd
Any information on this would be greatly appreciated 😁

Ssl with asynchttpserver

2023-08-19 Thread Cnerd
I just compiled with with the `-d:ssl` flag, and I still got the same problem.

Calling compiler flags in file

2024-03-08 Thread Cnerd
I am trying to call the compiler flags `--threads:off` and `--mm:arc` from the nim file I am working on. Is there a nim way to do this.

Calling compiler flags in file

2024-03-10 Thread Cnerd
Thanks 👍🏽

Declaring ambigious tuples

2024-04-08 Thread Cnerd
Hello I am trying to declare ambigious tuples as a type for a field on an object type type EntryFunctionPayload* = object moduleid* : ModuleId function* : string type_arguments* : seq[string] ## tuple of TypeTags ## TODO :: che

Nim's equivalent of kwargs

2024-04-09 Thread Cnerd
Is there a nim equivalent to python kwargs?

Proc inheritance for distinct type in Nim 2.0.0

2024-05-26 Thread Cnerd
If a type of `distinct string` is created, does it automatically inherits the move semantics procs of string like `=destroy`, `=sink` and the likes, or does it have to be explicitly declared. Also is there any consequences to memory safety if these procs are not inherited

Proc inheritance for distinct type in Nim 2.0.0

2024-05-26 Thread Cnerd
Pls can you give code examples of overrides for the move semantics procs for a `distinct string` type

Which IDE to use in 2024?

2024-05-27 Thread Cnerd
I personally use neovim with nvchad, it's easy to setup as nvchad will do most of the configuration for you. You just need * A good YouTube video or article on how to setup nvchad for neovim * Install the nim_languageserver plugin using mason * Edit nvchad config to use nim_languageserver

Nim ask for the Aptos Blockchain, nimAptos

2024-06-20 Thread Cnerd
I present to you folks, after a year of working on this project. . This is Nim's sdk for the Aptos Blockchain. Also accompanying this project is which is implementation of binary canonical serialization in Nim. BCS is great

Nim ask for the Aptos Blockchain, nimAptos

2024-06-20 Thread Cnerd
Thank you for the feedback, I'll look into it and implement a fix immediately.

Small libraries you'd like to see ported to Nim?

2024-07-19 Thread Cnerd
I would like to see someone work on a widget library using Would also be nice if the library leveraged Nim's meta programming powers to provide syntactic sugars.