Skip to content

Instantly share code, notes, and snippets.

View hannojg's full-sized avatar
👨‍💻

Hanno J. Gödecke hannojg

👨‍💻
View GitHub Profile
@mrousavy
mrousavy / MEMOIZE.md
Last active September 26, 2024 13:19
Memoize!!! 💾 - a react (native) performance guide
In computing, memoization or memoisation
is an optimization technique used primarily
to speed up computer programs by storing
the results of expensive function calls and  
returning the cached result when the same
inputs occur again.                                         
                                                     — wikipedia
@sorenlouv
sorenlouv / determine-changed-props.js
Last active April 18, 2024 16:21
Determine which props causes React components to re-render
import React, { Component } from 'react';
export default function withPropsChecker(WrappedComponent) {
return class PropsChecker extends Component {
componentWillReceiveProps(nextProps) {
Object.keys(nextProps)
.filter(key => {
return nextProps[key] !== this.props[key];
})
.map(key => {
@programmarchy
programmarchy / build-app-icon.sh
Last active May 12, 2020 10:11
Given a high resolution icon image, use imagemagick to scale down to all iOS app icon dimensions
APP_NAME="YOUR_APP_NAME_HERE"
SRC=./Design/AppIcon.png
DST=./$APP_NAME/Assets.xcassets/AppIcon.appiconset
convert $SRC -resize 1024x1024 "$DST/AppIcon1024x1024.png"
convert $SRC -resize 2048x2048 "$DST/AppIcon2048x2048.png"
convert $SRC -resize 29x29 "$DST/AppIcon29x29.png"
convert $SRC -resize 58x58 "$DST/[email protected]"
convert $SRC -resize 87x87 "$DST/[email protected]"
convert $SRC -resize 80x80 "$DST/[email protected]"
@parmentf
parmentf / GitCommitEmoji.md
Last active November 15, 2024 20:33
Git Commit message Emoji
@smockle
smockle / gif.sh
Last active July 25, 2020 05:34
Convert .mov to .gif in OS X with ffmpeg & imagemagick
ffmpeg -i in.mov -vf scale=800:-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 5 -layers Optimize -loop 0 - out.gif
  • 🎨 when improving the format/structure of the code
  • 🚀 when improving performance
  • ✏️ when writing docs
  • 💡 new idea
  • 🚧 work in progress
  • ➕ when adding feature
  • ➖ when removing feature
  • 🔈 when adding logging
  • 🔇 when reducing logging
  • 🐛 when fixing a bug
@denji
denji / nginx-tuning.md
Last active November 5, 2024 10:10
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.