Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thisago
thisago / helloworld.nim
Created September 26, 2023 22:29
Hello world?
using
s: string
s1: string
type A = string
func h(s):A="l"&s
func e(s):A=s&"e"
func w(s):A="g"&s
func o(s):A="u"&s
func r(s):A="t"&s
func l(s):A="a"&s
@thisago
thisago / connect.md
Created September 19, 2023 01:26
Linkedin `connect` button auto click

Linkedin connect button auto click

Just run in the Linkedin console and all Connect buttons will be pressed

[...document.querySelectorAll(".mt2 button.artdeco-button.artdeco-button--2.artdeco-button--secondary.ember-view.full-width")].map(b => b.innerText == "Connect" ? b.click() : "")
@thisago
thisago / ocr.md
Created September 12, 2023 13:23
OCR last screenshot in Fish shell

OCR last screenshot in Fish shell

set img ~/Pictures/Screenshots/(echo (ls ~/Pictures/Screenshots -t)[1]) && open $img && tesseract $img -
@thisago
thisago / upload.php
Last active September 22, 2022 21:51
Upload the file with a custom (optional) subfolder
<?php
// Upload the file with a custom (optional) subfolder
define("MAX_SIZE", 20097152); // 20mb in bytes
if (isset($_FILES['file'])) {
$errors = array();
$file_name = time() . "_" . $_FILES['file']['name'];
$file_size = $_FILES['file']['size'];
$file_tmp = $_FILES['file']['tmp_name'];
$file_type = $_FILES['file']['type'];
@thisago
thisago / nimInit.sh
Created October 2, 2021 20:29
The file (gist) is named `.sh` to have syntax highlighting
# Init nim project (fish)
# init nimble
nimble init -y
# Save current dir
set dir (basename "$PWD")
# Add tasks
function task
@thisago
thisago / formExporter.md
Last active November 10, 2021 23:38
JS form data json exporter and importer

Form Exporter

JS form data json exporter and importer

For export

function exportForm() {
  return JSON.stringify([...document.querySelectorAll("input[name], input[id]")].
 map(el =&gt; ({[el.id ? `#${el.id}` : `[name=${el.name}]`]: el.value})).