Skip to content

Instantly share code, notes, and snippets.

Be mindful of your Creator! We all will die soon...

Orkhan Alikhanov OrkhanAlikhanov

Be mindful of your Creator! We all will die soon...
View GitHub Profile
jgeewax / configure-mailgun
Created December 7, 2015 17:59
Script to configure Postfix for Mailgun
View configure-mailgun
# Configuration for the script
function confirm () {
read -r -p "${1:-Are you sure? [Y/n]} " response
if [[ $response == "" || $response == "y" || $response == "Y" ]]; then
echo 0;
zacwest / ios-font-sizes.swift
Last active May 31, 2023 09:56
iOS default font sizes - also available on
View ios-font-sizes.swift
let styles: [UIFont.TextStyle] = [
// iOS 11
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
for style in styles {
mondain / public-stun-list.txt
Created February 15, 2016 23:38
Public STUN server list
View public-stun-list.txt
kinichiro / 1_Hello_libtls
Last active April 28, 2023 06:36
Hello libtls - libressl libtls API sample program
View 1_Hello_libtls
Hello libtls - libressl libtls API sample program
philipstanislaus / sane-caching.nginx.conf
Last active April 19, 2023 11:56
Sample Nginx config with sane caching settings for modern web development
View sane-caching.nginx.conf
# Sample Nginx config with sane caching settings for modern web development
# Motivation:
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools.
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh
# and juicy version of your assets available.
# At some point, however, you want to show your work to testers, your boss or your client.
# After you implemented and deployed their feedback, they reload the testing page – and report
# the exact same issues as before! What happened? Of course, they did not have developer tools
# open, and of course, they did not empty their caches before navigating to your site.
ericclemmons /
Last active May 1, 2023 15:36
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

 Summary Goes Here
stefanbuck /
Last active March 26, 2023 16:21
Script to upload a release asset using the GitHub API v3.
#!/usr/bin/env bash
# Author: Stefan Buck
# License: MIT
# This script accepts the following parameters:
# * owner
procrastinatio /
Created October 25, 2017 06:04
Rate limiting with HAproxy


So HAProxy is primalery a load balancer an proxy for TCP and HTTP. But it may act as a traffic regulator. It may also be used as a protection against DDoS and service abuse, by maintening a wide variety of statistics (IP, URL, cookie) and when abuse is happening, action as denying, redirecting to other backend may undertaken ([haproxy ddos config], [haproxy ddos])

ccwasden / WithPopover.swift
Created February 5, 2020 13:39
Custom size popover in iOS SwiftUI
View WithPopover.swift
// -- Usage
struct Content: View {
@State var open = false
@State var popoverSize = CGSize(width: 300, height: 300)
var body: some View {
showPopover: $open,
popoverSize: popoverSize,
slikts /
Last active April 19, 2023 12:45
Why using the `children` prop makes `React.memo()` not work

Why using the children prop makes React.memo() not work

I've recently ran into a pitfall of [React.memo()][memo] that seems generally overlooked; skimming over the top results in Google just finds it mentioned in passing in a [React issue][regit], but not in the [FAQ] or API [overview][react-api], and not in the articles that set out to explain React.memo() (at least the ones I looked at). The issue is specifically that nesting children defeats memoization, unless the children are just plain text. To give a simplified code example:

const Memoized = React.memo(({ children }) => (<div>{children}</div>));
// Won't ever re-render
// Will re-render every time; the memoization does nothing