Skip to content

Instantly share code, notes, and snippets.

@drygdryg
drygdryg / iw_wpa_supplicant_static.txt
Last active February 4, 2023 03:44
Сборка статично скомпонованных беспроводных утилит для Linux ARM (Android): iw и wpa_supplicant
View iw_wpa_supplicant_static.txt
Сборка статичного iw в Alpine:
# Установка базового инструментария для сборки
apk add build-base
mkdir iw_static
cd iw_static/
wget https://github.com/thom311/libnl/releases/download/libnl3_5_0/libnl-3.5.0.tar.gz
mkdir prefix
tar xvf libnl-3.5.0.tar.gz
cd libnl-3.5.0/
@denji
denji / golang-tls.md
Last active February 4, 2023 03:43 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples
View golang-tls.md

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@JohnSundell
JohnSundell / ContentViewWithCollapsableHeader.swift
Created January 30, 2023 11:39
A content view which renders a collapsable header that adapts to the current scroll position. Based on OffsetObservingScrollView from https://swiftbysundell.com/articles/observing-swiftui-scrollview-content-offset.
View ContentViewWithCollapsableHeader.swift
/// View that renders scrollable content beneath a header that
/// automatically collapses when the user scrolls down.
struct ContentView<Content: View>: View {
var title: String
var headerGradient: Gradient
@ViewBuilder var content: () -> Content
private let headerHeight = (collapsed: 50.0, expanded: 150.0)
@State private var scrollOffset = CGPoint()
@Helw150
Helw150 / parallel_t5.py
Last active February 4, 2023 03:40
Flan T5 Parallel Usage
View parallel_t5.py
from transformers import AutoTokenizer, T5ForConditionalGeneration
# Model Init
n_gpu = 8
tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-xxl")
model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-xxl")
heads_per_gpu = len(model.encoder.block) // n_gpu
device_map = {
gpu: list(
range(
@MuhammadSaim
MuhammadSaim / rarreg.key
Last active February 4, 2023 03:40
Step 1: Create a file called rarreg.key Step 2: Paste into the file the raw content of this gist Step 3: Go to Winrar install directory (by default => c:\ProgramFiles\WinRAR\ ) Step 4: Paste the rarreg.key into WinRAR directory Step 5: Enjoy
View rarreg.key
RAR registration data
WinRAR
Unlimited Company License
UID=4b914fb772c8376bf571
6412212250f5711ad072cf351cfa39e2851192daf8a362681bbb1d
cd48da1d14d995f0bbf960fce6cb5ffde62890079861be57638717
7131ced835ed65cc743d9777f2ea71a8e32c7e593cf66794343565
b41bcf56929486b8bcdac33d50ecf773996052598f1f556defffbd
982fbe71e93df6b6346c37a3890f3c7edc65d7f5455470d13d1190
6e6fb824bcf25f155547b5fc41901ad58c0992f570be1cf5608ba9
@NeilsUltimateLab
NeilsUltimateLab / Understanding UIViewController Rotation when embed in Container View Controllers.md
Last active February 4, 2023 03:39
Understanding UIViewController rotation when embed in Container View Controllers.
View Understanding UIViewController Rotation when embed in Container View Controllers.md

Understanding UIViewController Rotation

Problem

To enable the rotation of a single view controller used to display the preview of Images/Videos. It is intuitive to allow user to rotate there device and screen changes accordingly, so it feels pleasant. But to achieve this, we need to enable the (almost) all Supported Device orientations.

Ex: `Portrait`, `LandscapeLeft`, `LandscapeRight`.
@tykurtz
tykurtz / grokking_to_leetcode.md
Last active February 4, 2023 03:39
Grokking the coding interview equivalent leetcode problems
View grokking_to_leetcode.md

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

View websockets.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- websockets.xml -->
<mule
xmlns:java="http://www.mulesoft.org/schema/mule/java"
xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting"
xmlns:websocket="http://www.mulesoft.org/schema/mule/websocket"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@ekzhang
ekzhang / Scanner.ipynb
Created January 31, 2023 23:21
Scanning sheet music for fun and profit
View Scanner.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.