Skip to content

Instantly share code, notes, and snippets.

@vishnuhd
vishnuhd / mysql-client-k8s.md
Created August 22, 2019 13:21
mysql-client in Kubernetes to test your connection to mysql server

mysql-client in Kubernetes to test your connection to mysql server

kubectl run mysql-client --image=mysql:5.7 -it --rm --restart=Never -- /bin/bash

mysql -h mysql-service -uroot -proot_password -e 'SHOW databases;'

OR

mysql -h mysql-service -uroot -proot_password

@leonardofed
leonardofed / README.md
Last active April 24, 2024 01:47
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@Attunewise
Attunewise / ConvertFunctions.py
Last active April 24, 2024 01:44
Convert OpenAI functions to system prompt that works with other LLMs
# Converts OpenAI compatible function calling JSON schema to a prompt that instructs the LLM to return
# a JSON object that is a choice of a function call conforming to one of the functions or a message reply
def convert_schema_to_typescript(schema):
if not schema:
return 'any'
if '$ref' in schema:
return schema['$ref'].replace('#/definitions/', '')
@hans-crypto
hans-crypto / bitcoin-inscription-service.ts
Last active April 24, 2024 01:43
Extracts the first inscription from a Bitcoin transaction.
import axios from 'axios';
/**
* Bitcoin Script Opcodes
* see https://en.bitcoin.it/wiki/Script
*/
const OP_FALSE = 0x00;
const OP_IF = 0x63
const OP_0 = 0x00;
@paulirish
paulirish / what-forces-layout.md
Last active April 24, 2024 01:42
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@sundowndev
sundowndev / GoogleDorking.md
Last active April 24, 2024 01:39
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
@nuclearsecrecy
nuclearsecrecy / pdfexpert_batch_ocr.applescript
Last active April 24, 2024 01:38
Applescript to batch run OCR on many PDF files using PDF Expert
# Applescript to batch OCR PDFs using PDF Expert.
# By Alex Wellerstein. Last updated March 14, 2024. No copyright asserted -- released for public domain use.
# Absolutely no warranties, guarantees, promises, ANYTHING provided. Use at your own risk.
# This is NOT affiliated with PDF Expert or Readdle in any way.
#
# Will automatically save and close each PDF after OCR completes.
# Assumes PDF Expert is the default program to open PDFs!
# Does not have robust error handling. Held together with duct tape.
# Just a temporary solution until Readdle builds in actual automation support (one can dream...).
# Seems to work on OS 14.3.1, with PDF Expert 3.9.2.
@atenni
atenni / README.md
Last active April 24, 2024 01:36
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

/**
* The following code is derived from the original code from: http://schemingdeveloper.com.
* The derived version was developed by Rune Skovbo Johansen - http://runevision.com
*
* Modifications in the derived version:
*
* - Averaged normals are calculated as a weighted average based on face area,
* known as "face weighted normals" or "area weighted normals".
*
* - An ignoreFactor parameter has been added which can cull normals from the average
@bradtraversy
bradtraversy / terminal-commands.md
Last active April 24, 2024 01:35
Common Terminal Commands

Common Terminal Commands

Key Commands & Navigation

Before we look at some common commands, I just want to note a few keyboard commands that are very helpful:

  • Up Arrow: Will show your last command
  • Down Arrow: Will show your next command
  • Tab: Will auto-complete your command
  • Ctrl + L: Will clear the screen