Skip to content

Instantly share code, notes, and snippets.

Avatar
☝️
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
View eslint-plugin-react-hooks+4.6.0.patch
diff --git a/node_modules/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js b/node_modules/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js
index 441442f..a536c7a 100644
--- a/node_modules/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js
+++ b/node_modules/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js
@@ -735,7 +735,29 @@ var ExhaustiveDeps = {
},
enableDangerousAutofixThisMayCauseInfiniteLoops: {
type: 'boolean'
- }
+ },
@slikts
slikts / react-memo-children.md
Last active March 21, 2023 15:28
Why using the `children` prop makes `React.memo()` not work
View react-memo-children.md

nelabs.dev

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
<Memoized>bar</Memoized>
// Will re-render every time; the memoization does nothing
@ccwasden
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 {
WithPopover(
showPopover: $open,
popoverSize: popoverSize,
@stefanbuck
stefanbuck / upload-github-release-asset.sh
Last active December 7, 2022 07:05
Script to upload a release asset using the GitHub API v3.
View upload-github-release-asset.sh
#!/usr/bin/env bash
#
# Author: Stefan Buck
# License: MIT
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447
#
#
# This script accepts the following parameters:
#
# * owner
@ericclemmons
ericclemmons / example.md
Last active March 3, 2023 08:01
HTML5 <details> in GitHub
View example.md

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!

<details>
 Summary Goes Here
@philipstanislaus
philipstanislaus / sane-caching.nginx.conf
Last active March 15, 2023 07:28
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.
@kinichiro
kinichiro / 1_Hello_libtls
Last active March 9, 2023 07:59
Hello libtls - libressl libtls API sample program
View 1_Hello_libtls
Hello libtls - libressl libtls API sample program
@mondain
mondain / public-stun-list.txt
Created February 15, 2016 23:38
Public STUN server list
View public-stun-list.txt
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
@zacwest
zacwest / ios-font-sizes.swift
Last active March 20, 2023 00:34
iOS default font sizes - also available on https://www.iosfontsizes.com
View ios-font-sizes.swift
let styles: [UIFont.TextStyle] = [
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]
for style in styles {
@jgeewax
jgeewax / configure-mailgun
Created December 7, 2015 17:59
Script to configure Postfix for Mailgun
View configure-mailgun
#!/bin/bash
# Configuration for the script
POSTFIX_CONFIG=/etc/postfix/main.cf
POSTFIX_SASL=/etc/postfix/sasl_passwd
function confirm () {
read -r -p "${1:-Are you sure? [Y/n]} " response
if [[ $response == "" || $response == "y" || $response == "Y" ]]; then
echo 0;