Skip to content

Instantly share code, notes, and snippets.

//
// ContentView.swift
// MadeForYouCard
//
// Created by AppleDesignDev on 1/24/22.
//
import SwiftUI
struct ContentView: View {
@v-fox
v-fox / NVMe_tweaks.md
Last active May 4, 2024 15:52
Linux kernel optimizations for NVMe

By default Linux distros are unoptimized in terms of I/O latency. So, here are some tips to improve that.

The performance can be checked by:

  • fio --name=read --readonly --rw={read/randread} --ioengine=libaio --iodepth={jobs_per_each_worker's_command} --bs={4k/2M} --direct={0/1} --numjobs=<number_of_parallel_workers> --runtime={10/30/60} --group_reporting --filename=/dev/nvme<device> - to simulate an optimized app;
  • dd_rescue /dev/nvme<device> /dev/null -b {4k/2M} {-d} - to simulate a stupid app.

Appropriate settings are changed in appropriate places, such as:

  • /etc/tuned/<custom-profile>/tuned.conf:
@ryanchang
ryanchang / lldb_cheat_sheet.md
Last active May 4, 2024 15:49
LLDB Cheat Sheet

LLDB Cheat Sheet

A complete gdb to lldb command map.

Print out

  • Print object
(lldb) po responseObject
(lldb) po [responseObject objectForKey@"state"]
  • p - Print primitive type
@secfb
secfb / Web-Attack-Cheat-Sheet.md
Created May 8, 2020 20:53
Web-Attack-Cheat-Sheet.md

Web-Attack-Cheat-Sheet

Discovering

Bug Bount Targets

https://github.com/arkadiyt/bounty-targets-data

IP Enumeration

http://www.asnlookup.com/
@sindresorhus
sindresorhus / esm-package.md
Last active May 4, 2024 15:48
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@joelonsql
joelonsql / PostgreSQL-EXTENSIONs.md
Last active May 4, 2024 15:47
1000+ PostgreSQL EXTENSIONs

🗺🐘 1000+ PostgreSQL EXTENSIONs

This is a list of URLs to PostgreSQL EXTENSION repos, listed in alphabetical order of parent repo, with active forks listed under each parent.

⭐️ >= 10 stars
⭐️⭐️ >= 100 stars
⭐️⭐️⭐️ >= 1000 stars
Numbers of stars might not be up-to-date.

@dedunumax
dedunumax / .gitignore Java
Last active May 4, 2024 15:45
A complete .gitignore file for Java.
##############################
## Java
##############################
.mtj.tmp/
*.class
*.jar
*.war
*.ear
*.nar
hs_err_pid*
@cseeman
cseeman / markdown_examples.md
Created September 15, 2023 16:48
Markdown for info panel/warning box

Examples for how to create your own info panel, warning box and other decent looking notification in GitHub markdown.

All the boxes are single/two cell tables or two row tables.

Warning box

❗ You have to read about this
@rochacbruno
rochacbruno / fastapi_session.py
Last active May 4, 2024 15:43
Session based cookie auth fastapi
from fastapi import Request, Depends, HTTPException, Response
from fastapi.responses import RedirectResponse
# This must be randomly generated
RANDON_SESSION_ID = "iskksioskassyidd"
# This must be a lookup on user database
USER_CORRECT = ("admin", "admin")
# This must be Redis, Memcached, SQLite, KV, etc...