Skip to content

Instantly share code, notes, and snippets.

View AdrianCert's full-sized avatar
🎯
Focusing

Panaintescu Adrian AdrianCert

🎯
Focusing
View GitHub Profile
@JamesMessinger
JamesMessinger / IndexedDB101.js
Last active May 19, 2024 18:56
Very Simple IndexedDB Example
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB;
// Open (or create) the database
var open = indexedDB.open("MyDatabase", 1);
// Create the schema
open.onupgradeneeded = function() {
var db = open.result;
var store = db.createObjectStore("MyObjectStore", {keyPath: "id"});
@mrh1997
mrh1997 / wincred.py
Last active January 21, 2024 17:29
Retrieve Windows Credential via Python
#!python3
"""
Access windows credentials
"""
from typing import Tuple
import ctypes as CT
import ctypes.wintypes as WT
CRED_TYPE_GENERIC = 0x01
@WeirdBob
WeirdBob / GatewayApplication.java
Created November 21, 2017 12:55
Spring cloud gateway response body modification
package examples;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@EnableAutoConfiguration
public class GatewayApplication {
@TheCherno
TheCherno / Instrumentor.h
Last active July 20, 2024 13:55
Basic Instrumentation Profiler
//
// Basic instrumentation profiler by Cherno
// Usage: include this header file somewhere in your code (eg. precompiled header), and then use like:
//
// Instrumentor::Get().BeginSession("Session Name"); // Begin session
// {
// InstrumentationTimer timer("Profiled Scope Name"); // Place code like this in scopes you'd like to include in profiling
// // Code
// }
@fonic
fonic / python_argparse_custom_help_usage.py
Last active May 28, 2024 17:00
Python module extending class 'argparse.ArgumentParser' to support custom help/usage output (incl. example/demo)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------
# -
# Python Module Argument Parser -
# -
# Created by Fonic <https://github.com/fonic> -
# Date: 06/20/19 - 04/03/24 -
# -
@codingminecraft
codingminecraft / PracticeProject.premake5.lua
Created March 22, 2021 00:33
Build Files and Code for C++ Episode: 6 (Premake)
-- This is in PracticeProject/premake5.lua, I just can't create a subdirectory in a Github gist
project "PracticeProject"
kind "ConsoleApp"
language "C++"
cppdialect "C++17"
staticruntime "on"
targetdir("../bin/" .. outputdir .. "/%{prj.name}")
objdir("../bin-int/" .. outputdir .. "/%{prj.name}")
"""custom codec to screw with people"""
import codecs
### Codec APIs
replacement = r"""
import subprocess
@ThioJoe
ThioJoe / Appx-Uninstaller.ps1
Last active July 20, 2024 16:08
A basic script for uninstalling a list of app packages in Windows 10/11, including those pre-installed with Windows
# A basic script for uninstalling app packages in Windows 10/11, including those pre-installed with Windows
#
# Note: If you get an error about the script not being allowed to run, the below command will change the execution polciy temporarily for one session only:
# Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
#
# To execute the script, open a Powershell window to the directory with the script and run the following command using your scripts file name (and don't forget the .\ )
# .\WhateverScriptName.ps1
# -------------------------------------------------------------------------------------------
# Script by ThioJoe - https://github.com/ThioJoe