Skip to content

Instantly share code, notes, and snippets.

@paulirish
paulirish / what-forces-layout.md
Last active March 29, 2024 13:42
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@ruevaughn
ruevaughn / 1_top+hacker_methodologies.md
Last active March 29, 2024 13:42
Hacker Methodologies & Tools (NEW)

The Top Hacker Methodologies & Tools Notes

Nuclei Templates

Concrete5 CMS : Identification, Mass Hunting, Nuclei Template Writing & Reporting


Parallelizing the Naughty Dog engine using fibers by Christian Gyrling
http://www.swedishcoding.com/wp-content/uploads/2015/03/parallelizing_the_naughty_dog_engine_using_fibers.pdf
id Tech 5 Challenges
From Texture Virtualization to Massive Parallelization by J.M.P. van Waveren
http://s09.idav.ucdavis.edu/talks/05-JP_id_Tech_5_Challenges.pdf
Doom3 BFG Source Code Review: Multi-threading by Fabien Sanglard
@sujeetkv
sujeetkv / npm-with-private-repo.md
Last active March 29, 2024 13:40
Use private repo as npm dependency.

Use private repo as npm dependency

Create Deploy-Token (Access-Token) for particular private repo and use it in dependency as following:

{
    "dependencies": {
        "package-name": "git+https://<username>:<access_token>@github.com/username/repository#{branch|tag}"
    }
}
@learncodeacademy
learncodeacademy / pubsub.js
Created July 29, 2015 02:54
Basic Javascript PubSub Pattern
//events - a super-basic Javascript (publish subscribe) pattern
var events = {
events: {},
on: function (eventName, fn) {
this.events[eventName] = this.events[eventName] || [];
this.events[eventName].push(fn);
},
off: function(eventName, fn) {
if (this.events[eventName]) {
import Foundation
import PlaygroundSupport
/// A thread-safe array.
public class SynchronizedArray<Element> {
private let queue = DispatchQueue(label: "io.zamzam.ZamzamKit.SynchronizedArray", attributes: .concurrent)
private var array = [Element]()
public init() { }
@patrickmoffitt
patrickmoffitt / wxWidgets3_Hello_World_Ubuntu_18_CMake.md
Created February 13, 2020 23:37
Step-by-step instructions for installing wxWidgets 3.0 and CMake on Ubuntu 18 for the purpose of building and running the Hello World! demo application.

How to Build wxWidgets 3.0 Hello World! on Ubuntu 18 with CMake

Install wxWidgets 3.0

sudo apt-get update
sudo apt-get full upgrade
sudo apt install wx-common wx3.0-doc wx3.0-examples wx3.0-headers wx3.0-i18n \
cmake libwxbase3.0-dev libwxbase3.0-dev libwxgtk-media3.0-dev \
libwxgtk-media3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev libwxgtk3.0-dev \
libwxgtk3.0-gtk3-dev libwxsqlite3-3.0-dev libcanberra-gtk-dev \
@rxaviers
rxaviers / gist:7360908
Last active March 29, 2024 13:34
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@pirate
pirate / docker-compose-backup.sh
Last active March 29, 2024 13:33
Backup a docker-compose project, including all images, named and unnamed volumes, container filesystems, config, logs, and databases.
#!/usr/bin/env bash
### Bash Environment Setup
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
# set -o xtrace
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
@handcoding
handcoding / Ashley’s Light Fader.yaml
Last active March 29, 2024 13:32
This script for Home Assistant will fade a lamp over time with your choice of easing, including varieties of ease-in, ease-out, and ease-in-out.
alias: Ashley’s Light Fader
description: >
Fades a lamp over time. If you have any questions or comments about this
script, feel free to tweet Ashley Bischoff at @FriendlyAshley. Released under
the Apache 2.0 license. (v2.0)
fields:
light:
name: πŸ’‘ Light
description: entity_id of the lamp.
selector: