Skip to content

Instantly share code, notes, and snippets.

@sundowndev
sundowndev / GoogleDorking.md
Last active July 3, 2024 01:12
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"
@dgca
dgca / typescript-png-pixel-art-generator.ts
Last active July 3, 2024 01:09
Zero dependency function to generate an image in PNG format and return it as a base64-encoded string
/**
* Generates an image in PNG format and returns it as a base64-encoded string.
*
* @param colors - An array of color values
* @param pixels - An array of pixel values
* @param width - The width of the image
* @param height - The height of the image
* @param scale - The scale factor to apply to the image (default: 1, uses nearest-neighbor interpolation)
* @returns The base64-encoded string representation of the generated image
*/
@sebastiancarlos
sebastiancarlos / toggle_jobs.bash
Last active July 3, 2024 01:06
Toggle between the last two jobs in Bash by pressing "Ctrl-Z Ctrl-Z" (Or toggle between the shell and your single job by pressing "Ctrl-Z")
# All my gist code is licensed under the terms of the MIT license.
# Video demo: https://www.youtube.com/shorts/0zx4uSBUt_k
# Add this somewhere in your ~/.bashrc
# Use bash-preexec.sh (https://github.com/rcaloras/bash-preexec) to:
# - disable the Ctrl-Z keybinding before printing the prompt
# - enable the Ctrl-Z keybinding before executing a command
#
@MrChuffmanSnippets
MrChuffmanSnippets / index.html
Created March 15, 2012 10:05
HTML5: Blank Template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<link href="style.css" rel="stylesheet" />
</head>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
@scanny
scanny / rst_renderer.py
Created March 2, 2015 20:36
Code to translate RestructuredText into Microsoft Word document using python-docx
# encoding: utf-8
"""
Helper objects for rendering to .docx format.
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
package main
import (
"log"
"sort"
)
// Interface type used for vars
type Sortable[T comparable] interface {
Less(member T) bool
@EitanBlumin
EitanBlumin / Calculate Max Memory for SQL.sql
Created July 16, 2018 13:57
Calculate Max Memory for SQL Server Instance
-- Max Memory Calculation
-- Based on Tiger Toolbox script BP_Check (Copyright Pedro Lopes)
DECLARE @sqlmajorver int, @systemmem int, @systemfreemem int, @maxservermem int, @numa_nodes_afinned int, @numa int
DECLARE @mwthreads_count int, @mwthreads int, @arch smallint, @sqlcmd nvarchar(4000)
DECLARE @MinMBMemoryForOS INT, @RecommendedMaxMemMB INT
SET @sqlmajorver = CONVERT(int, (@@microsoftversion / 0x1000000) & 0xff);
SET @arch = CASE WHEN @@VERSION LIKE '%<X64>%' THEN 64 WHEN @@VERSION LIKE '%<IA64>%' THEN 128 ELSE 32 END;
SELECT @maxservermem = CONVERT(int, [value]) FROM sys.configurations (NOLOCK) WHERE [Name] = 'max server memory (MB)';
@EitanBlumin
EitanBlumin / Review SQL Instance Best Practices.sql
Last active July 3, 2024 00:25
Condensed SQL Server Checkup of most common and impactful best practices
/*
Author: Eitan Blumin (t: @EitanBlumin | b: eitanblumin.com)
Date: February, 2019
Description:
This is a condensed SQL Server Checkup of most common and impactful best practices.
Some of the checks are based on BP_Check.sql in Tiger Toolbox (by Pedro Lopez)
*/
DECLARE
@NumOfMinutesBackToCheck INT = 360,
@MinutesBackToCheck INT = 360,
@BlockmanCodes
BlockmanCodes / Staking.js
Created April 3, 2022 12:40
Deposit and withdraw ERC20 tokens (USDT, SHIB, MATIC) from a Solidity contract (Hardhat, Ethers.js)
const { expect } = require("chai");
describe('Staking', function () {
beforeEach(async function() {
[owner, wallet1, wallet2] = await ethers.getSigners();
Staking = await ethers.getContractFactory('Staking', owner);
Wbtc = await ethers.getContractFactory('Wbtc', wallet1);
staking = await Staking.deploy();
wbtc = await Wbtc.deploy();