Skip to content

Instantly share code, notes, and snippets.

View djrobby's full-sized avatar

Robby Dhillon djrobby

  • Detroit, MI - USA
View GitHub Profile
@djrobby
djrobby / queryselector.js
Created December 22, 2022 15:37 — forked from shitalm/queryselector.js
querySelectorAll with regex support
/**
* querySelectorAll with regex support.
* TS version: https://gist.github.com/sagirk/3240407ebbc9369356759a806b66fe34.
*
* Note: In the `attributeToSearch` parameter's absence, all attributes on all
* DOM nodes will be searched. This can get quite expensive for large DOM trees.
*
* Usage example:
* `querySelectorAllRegex(/someregex/, 'target-specific-attribute-if-needed');`
*
@djrobby
djrobby / onload.js
Created November 12, 2022 17:49 — forked from jsonberry/onload.js
Window vs. Document Loading Events
/**
Taken from: http://stackoverflow.com/questions/588040/window-onload-vs-document-onload
According to Parsing HTML documents - The end,
The browser parses the HTML source and runs deferred scripts.
A DOMContentLoaded is dispatched at the document when all the HTML has been parsed and have run. The event bubbles to the window.
The browser loads resources (like images) that delay the load event.
A load event is dispatched at the window.
Therefore, the order of execution will be
DOMContentLoaded event listeners of window in the capture phase
DOMContentLoaded event listeners of document
@djrobby
djrobby / AppleMap.jsx
Created June 15, 2022 17:04 — forked from Scanerrr/AppleMap.jsx
Apple mapkitJS places example
import { useCallback, useState } from "react";
import { useMap } from "./useMap";
import { useSearch } from "./useSearch";
export default function AppleMap() {
const { mapkit, map, mapRef } = useMap();
const search = useSearch();
const [value, setValue] = useState("");
const [adressesList, setAddressesList] = useState(null);
@djrobby
djrobby / vips.sh
Last active April 25, 2022 20:23 — forked from yellow1912/vips.sh
Install libvips on Ubuntu
#!/bin/bash
#https://www.libvips.org/install.html
VERSION="8.12.2"
echo ""
echo "---------------------------------"
echo "| AUTO COMPILE LIBVIPS |"
echo "---------------------------------"
echo ""
echo "-----------------------"
echo "Installing cgif"
@djrobby
djrobby / postgres_commands.md
Last active December 19, 2021 14:29
Postgres v12 Commands
Key Commands
  \l                                  list all databases
  \c <db name>                        connect/switch to a certain database
  \dt                                 list all tables in the current db

General
  \copyright                          show PostgreSQL usage and distribution terms
  \crosstabview [COLUMNS]             execute query and display results in crosstab
  \errverbose                         show most recent error message at maximum verbosity
@djrobby
djrobby / .bashrc
Created April 13, 2021 17:10 — forked from kshep92/.bashrc
Some handy functions for managing NginX
alias nx='/bin/bash ~/.scripts/nx.sh' # NginX scripts
@djrobby
djrobby / 1.9.3-p551.patch
Created April 12, 2021 14:26 — forked from cybniv/1.9.3-p551.patch
1.9.3-p551 patch (SSLv3, TLS 1.1/2 support, CVE-2015-1855 fix backport)
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index bfb1ea4..eaa2557 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -104,6 +104,15 @@ have_func("OPENSSL_cleanse")
have_func("SSLv2_method")
have_func("SSLv2_server_method")
have_func("SSLv2_client_method")
+have_func("SSLv3_method")
+have_func("SSLv3_server_method")
@djrobby
djrobby / Vultr Ubuntu startup script.sh
Created April 12, 2021 12:28 — forked from stvhwrd/Vultr Ubuntu startup script.sh
Setting up a general web dev Ubuntu VPS
# Startup script for Ubuntu 17.04 VPS on Vultr (Dev machine and cloud server)
# add a new user @todo: make this a one-liner
# adduser stvhwrd
# usermod -aG sudo stvhwrd
## MANUALLY LOG OUT AS ROOT AND LOG IN AS NEW USER
# OPTIONAL: to add ssh key, assuming that you have ssh-copy-id installed on local machine and your keypair is in ~/.ssh and named id_rsa:
# Locally, i.e. on your laptop. eg. ssh-copy-id stvhwrd@45.63.10.205
@djrobby
djrobby / deploy.sh
Created April 12, 2021 12:25 — forked from KaiserKatze/deploy.sh
Server initialization script for newly created Vultr VPS instances
#!/bin/bash
cat << EOF
#=============================================================================#
# Startup Boot Script #
# --------------------------------------------------------------------------- #
# Platform : Vultr VPS (Debian 9) #
# Author : KaiserKatze <donizyo@gmail.com> #
# --------------------------------------------------------------------------- #
# This startup script is saved to `/tmp/firstboot.exec` after execution. #
@djrobby
djrobby / vps-mn-boostratp-prep.sh
Created April 12, 2021 12:17 — forked from thephez/vps-mn-boostratp-prep.sh
Vultr boot startup script - mn-bootstrap prep
#!/bin/sh
# Based on instructions from
# https://docs.dash.org/en/stable/masternodes/setup-testnet.html
#
# See https://www.vultr.com/docs/vultr-startup-scripts-quickstart-guide
# for details of using Vultr startup scripts
# Add new user
USERNAME=yourusernamehere # Username to create