Skip to content

Instantly share code, notes, and snippets.

View shanielh's full-sized avatar
🚀

Shani Elharrar shanielh

🚀
View GitHub Profile
@dweldon
dweldon / install-docker.sh
Last active April 8, 2022 11:18
Install docker CE on Linux Mint 18.3
#!/usr/bin/env bash
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
sudo apt-get update
sudo apt-get install docker-ce
# https://docs.docker.com/compose/install/
@glimpsed
glimpsed / Selective VPN traffic routes.txt
Last active April 27, 2023 09:22
How to route network traffic through a VPN (OpenVPN/TunnelBlick) ONLY for specific websites/IPs only on macOS / OS X (static routing)
Add the following line at the top of your .ovpnfile to prevent it from routing all network traffic on your Mac through
the VPN:
route-nopull
Next add the following line to allow the VPN to reroute traffic ONLY for a given IP address / domain (if you need to enable it
for a domain you can use its IP address):
route 1.2.3.4
@pstoica
pstoica / OnBlurComponent.jsx
Last active August 1, 2023 21:00
onBlur for entire react element
function OnBlurComponent({ onBlur }) {
const handleBlur = (e) => {
const currentTarget = e.currentTarget;
// Check the newly focused element in the next tick of the event loop
setTimeout(() => {
// Check if the new activeElement is a child of the original container
if (!currentTarget.contains(document.activeElement)) {
// You can invoke a callback or add custom logic here
onBlur();
@rauchg
rauchg / ms.md
Created December 21, 2011 00:25
Milliseconds conversion utility.