Skip to content

Instantly share code, notes, and snippets.

@jboner
jboner / latency.txt
Last active April 24, 2024 13:53
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@esgomezm
esgomezm / dl4miceverywhere-practical-EBI-EMBL.md
Last active April 24, 2024 13:52
EBI-EMBL Microscopy data analysis course - DL4MicEverywhere practical session
@davidteren
davidteren / nerd_fonts.md
Last active April 24, 2024 13:52
Install Nerd Fonts via Homebrew [updated & fixed]
@arshednabeel
arshednabeel / vicsek.py
Last active April 24, 2024 13:52
A minimal implementation of the Vicsek model in ~50 lines of code
import numpy as np
from tqdm import trange
def get_neighbour_matrix(x, L, R):
dx = np.subtract.outer(x[:, 0], x[:, 0])
dy = np.subtract.outer(x[:, 1], x[:, 1])
dx[dx > (L / 2) ** 2] -= (L / 2) ** 2
dy[dy > (L / 2) ** 2] -= (L / 2) ** 2
pair_dist = dx ** 2 + dy ** 2

Reference: List of iOS App URL Scheme Names & Paths for Shortcuts

Author:

Saved on: 2021-03-19, 15:52

If you've ever customized your app icons or played around with Shortcuts (previously called Workflow), you probably know how important URL scheme names are. Nearly all iOS apps assign themselves one of these names, and you need to know them if you want to add custom icons to your home screen or create a Shortcuts workflow that opens an app on your iPhone up. Finding the URL scheme name, also known as a URI scheme, for a particular app is not easy. First, you have to download the IPA file for the app — a difficult task since the iTunes 12.7 update removed iOS apps from it. When you finally find the IPA, you have to turn it into a ZIP file, show the contents of the app package, then hunt for the specific PLIST file that contains the URL schemes. It's a lot of work.

This example

@Zoxive
Zoxive / gist:bcfc30e0518be6db8870efb12e16e8e4
Last active April 24, 2024 13:49
Favorite CSharp Analyzers
<PackageReference Include="SmartAnalyzers.CSharpExtensions.Annotations" Version="3.10.0" />
<PackageReference Include="AsyncSuffixAnalyzer" Version="1.0.6285.32977" PrivateAssets="All"/>
<PackageReference Include="Lindhart.Analyser.MissingAwaitWarning" Version="1.2.0" PrivateAssets="All"/>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.7" PrivateAssets="All"/>
<PackageReference Include="AsyncFixer" Version="1.1.6" PrivateAssets="All"/>
<PackageReference Include="Roslynator.Analyzers" Version="2.2.0" PrivateAssets="All"/>
<PackageReference Include="Roslynator.CodeFixes" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="Nopen.NET" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Apex.Analyzers.Immutable" Version="1.2.5" PrivateAssets="All" />
<PackageReference Include="Apex.Analyzers.Immutable.Attributes" Version="1.0.0" />
@myselfgautham
myselfgautham / ESPCameraServer.ino
Created April 24, 2024 13:37
A Camera Server For ESP32 AI Thinkers Camera Module With Support For Many Other Modules Serves Through WiFi
#include "esp_camera.h"
#include <WiFi.h>
#include "esp_timer.h"
#include "img_converters.h"
#include "Arduino.h"
#include "fb_gfx.h"
#include "soc/soc.h"
#include "soc/rtc_cntl_reg.h"
#include "esp_http_server.h"
@erikbern
erikbern / use_pfx_with_requests.py
Last active April 24, 2024 13:48
How to use a .pfx file with Python requests – also works with .p12 files
import contextlib
import OpenSSL.crypto
import os
import requests
import ssl
import tempfile
@contextlib.contextmanager
def pfx_to_pem(pfx_path, pfx_password):
''' Decrypts the .pfx file to be used with requests. '''
@valexandersaulys
valexandersaulys / README.md
Created April 24, 2024 13:47
Raise Nginx Proxy
@Jeiwan
Jeiwan / lightsail-docker.sh
Last active April 24, 2024 13:46 — forked from davidkryzaniak/lightsail-docker.sh
Auto-Install Docker and Docker Compose on AWS Lightsail
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
sudo apt-get install -y docker-engine
sudo curl -L "https://github.com/docker/compose/releases/download/1.9.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo groupadd docker