Skip to content

Instantly share code, notes, and snippets.

View juancarlospaco's full-sized avatar
👑
https://t.me/NimArgentina

Juan Carlos juancarlospaco

👑
https://t.me/NimArgentina
View GitHub Profile
@haxscramper
haxscramper / nim-features-you-didn-t-know-and-don-t-need-to.org
Last active December 4, 2020 22:09
Nim features you didn't know and don't need to

Nim features you didn’t know and don’t need to

Can put basically anything as identifier

Technically this is just function call using method call syntax - × is treated as regular identifier (like someFunction) and it is perfectly legal to call obj .someFunction arg. So a .× b is not really different in that regard.

proc ×(a, b: set[char]): seq[(char, char)] =
  for aIt in a:
    for bIt in b:
@haxscramper
haxscramper / languages-and-vms.md
Last active July 2, 2024 03:38
languages-and-vms
@0atman
0atman / wantyougone.nim
Last active June 6, 2020 18:52
The code from my music video, "Want You Gone", available here https://youtu.be/zvLGFe_8yWU
import strutils
import autotyperpkg/typer
const lyrics = """
Forms FORM-29827281-12-2:
Notice of Dismissal
Well here we are again
It's always such a pleasure
Remember when you tried
@0atman
0atman / fibber.nim
Last active April 12, 2020 04:00
IMO Nim is an advanced, complied superset of python
import math, strformat, times
func fib(n: int): int =
if n <= 2:
return 1
else:
return fib(n - 1) + fib(n - 2)
when isMainModule:
let x = 47
@ybiquitous
ybiquitous / skip-ci-on-actions.yml
Last active February 9, 2021 10:11
How to "[skip ci]" on GitHub Actions
# See also:
# - https://github.com/actions/runner/issues/774
# - https://help.github.com/en/actions/reference/events-that-trigger-workflows#push-event-push
# - https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request
# - https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions
name: "[skip ci]" on Actions
on: [push, pull_request]
@zbraniecki
zbraniecki / README.md
Last active November 7, 2024 03:55
Rust <--> C/C++ FFI for newbies

As Gecko is moving toward more Rust code, the cases where Rust and C code interoperate will become more common.

This document is an attempt to ease the learning curve for engineers facing it for the first time. It assumes no prior experience with cross-language C interfaces (called FFI).

It also assumes that Rust code is already built into Gecko. If you need help with that, read Introducing Rust code in Firefox.

What can you transfer across the fence

@fonic
fonic / nvidia-sensors.sh
Last active June 24, 2023 12:43
KDE KSysGuard NVIDIA GPU Sensors - see comments below for usage information
#!/usr/bin/env bash
# -------------------------------------------------------------------------
# -
# Created by Fonic (https://github.com/fonic) -
# Date: 12/29/19 - 02/12/20 -
# -
# Created for and tested on single-GPU system equipped with NVIDIA -
# GeForce RTX 2060 SUPER. For other systems, modifications might be -
# required. -
@RobertAKARobin
RobertAKARobin / python.md
Last active August 3, 2025 12:18
Python Is Not A Great Programming Language
@rjhansen
rjhansen / keyservers.md
Last active August 4, 2025 09:47
SKS Keyserver Network Under Attack

SKS Keyserver Network Under Attack

This work is released under a Creative Commons Attribution-NoDerivatives 4.0 International License.

Terminological Note

"OpenPGP" refers to the OpenPGP protocol, in much the same way that HTML refers to the protocol that specifies how to write a web page. "GnuPG", "SequoiaPGP", "OpenPGP.js", and others are implementations of the OpenPGP protocol in the same way that Mozilla Firefox, Google Chromium, and Microsoft Edge refer to software packages that process HTML data.

Who am I?

@mashingan
mashingan / poolconn.nim
Last active August 30, 2019 15:17
Pool connection test
import std/[deques, asyncdispatch, httpclient, tables, math, times]
type
Pool = ref object
conns: TableRef[int, AsyncHttpClient]
available: Deque[int]
method getConn(p: Pool): Future[(int, AsyncHttpClient)] {.base, async.} =
while true:
if p.available.len != 0: