Skip to content

Instantly share code, notes, and snippets.

@ElliotNB
ElliotNB / notify.sh
Last active December 5, 2023 02:35
Email sysadmin on every login from a new IP address
#!/bin/bash
##
## New IP login notification script
## 2009-11-20 00:28 Samuele ~redShadow~ Santi
## 2018-06-04 12:53 ElliotNB
## 2018-10-17 17:55 ElliotNB - bug fixes for non-interactive sessions and `sudo su` commands
## Licensed under GPL
##
## This script will email the contact specified below whenever
## a user logs into the system from a new IP address. The email will contain the
@paulirish
paulirish / what-forces-layout.md
Last active May 31, 2024 22:37
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
@robhrt7
robhrt7 / devshelf.sh
Last active August 7, 2021 21:06
Ubuntu init.d service example for nodeJS app with forever
#!/bin/bash
#
# description: DevShelf service
# processname: node
# pidfile: /var/run/devshelf.pid
# logfile: /var/log/devshelf.log
#
# Based on https://gist.github.com/jinze/3748766
#
# To use it as service on Ubuntu: