Skip to content

Instantly share code, notes, and snippets.

@HighwayofLife
HighwayofLife / cloud_init.yaml
Last active March 23, 2024 12:52
Install Docker via Cloud Init on Ubuntu VM
#cloud-config
packages:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
# Enable ipv4 forwarding, required on CIS hardened machines
@nicubarbaros
nicubarbaros / mentions.js
Created April 17, 2018 21:13
Draft Js Mentions
import { convertFromRaw, convertToRaw, ContentState } from 'draft-js';
const getIndicesOf = (searchStr, str, caseSensitive) => {
let tempStr = str;
let tempSearchStr = searchStr;
const searchStrLen = tempSearchStr.length;
if (searchStrLen === 0) {
return [];
}
let startIndex = 0;