Skip to content

Instantly share code, notes, and snippets.

View dhenson02's full-sized avatar
🏠
Working from home

Deryck dhenson02

🏠
Working from home
View GitHub Profile
@dhenson02
dhenson02 / .mwrc
Last active December 23, 2022 16:21
Keep me from maxing out RAM
# in kB
export MINIMUM_AVAILABLE_MEMORY=1400000
if [ ! -e "${NOTIFICATION_SOUND_PATH}" ]; then
export NOTIFICATION_SOUND_PATH="/fun/notification-sound-memory-alarm.mp3";
if [ -z "${NOTIFICATION_SOUND_SOURCE}" ]; then
export NOTIFICATION_SOUND_SOURCE="https://proxy.notificationsounds.com/wake-up-tones/gentle-alarm-474/download/file-sounds-928-gentle-alarm.mp3";
fi
@dhenson02
dhenson02 / index.html
Created December 3, 2022 10:16
CSS Loader generated by OpenAI ChatGPT
<div class="loading"></div>
@dhenson02
dhenson02 / connect.js
Last active June 27, 2021 08:16
Promisify HTTPS connections with vanilla Node
const https = require('https');
const defaultOptions = {
"port": 443,
"host": `127.0.0.1`,
"method": `GET`,
"headers": {
"Content-Type": `application/json`,
"Accept": `application/json`,
}
@dhenson02
dhenson02 / docker-compose.yml
Created April 4, 2020 03:06
Elasticsearch, Logstash, Kibana (ELK) stack docker-compose.yml (defaults, portable, no setup/config)
version: '3'
services:
es1:
image:
"docker.elastic.co/elasticsearch/elasticsearch:7.6.0"
ports:
- "9200:9200"
- "9300:9300"
environment:
- "discovery.type=single-node"
@dhenson02
dhenson02 / postgres_queries_and_commands.sql
Last active October 27, 2023 22:24 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (>=9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
var emit = commonjs.socket.emit.bind(commonjs.socket);
var onevent = commonjs.socket.onevent;
commonjs.socket.onevent = function ( packet ) {
var args = packet.data || [];
onevent.call(this, packet); // original call
packet.data = [ "*" ].concat(args);
onevent.call(this, packet); // additional call to catch-all
};
commonjs.socket.on("*", function ( event, data ) {
/**
* Custom deep diffing to tell what changes throughout our data transfers
* Don't recommend for testing functions or recursively-nested objects (like Backbone collections).
* @param item1 <>
* @param item2 <>
* @param [isReversed] <Boolean>
* @returns <Array>(Object*)
*/
function deepDiff ( item1, item2, isReversed ) {
@dhenson02
dhenson02 / README.md
Last active August 29, 2015 14:24
nginx-theme scroll sticky-menu fix

Your sticky-menu was broked, so I fixed it.

CSS

Problem:

#masthead is getting yanked from the layout and everything after it gets forced up to fill the 70px gap.