Skip to content

Instantly share code, notes, and snippets.

View brandonb927's full-sized avatar

Brandon Brown brandonb927

View GitHub Profile
@soxrok2212
soxrok2212 / Reolink RLC-810A Homebridge 4K Configuration.md
Last active April 3, 2024 22:16
Reolink RLC-810A Homebridge 4K Configuration
@mikkipastel
mikkipastel / app.js
Last active March 14, 2024 03:46
sample for cronjob in Discord.js for alert with standup meeting
const cron = require('node-cron');
const Discord = require("discord.js");
const client = new Discord.Client();
client.once('ready', async () => {
common.log('Ready!');
try {
const webhook = new Discord.WebhookClient(process.env.WEBHOOK_ID, process.env.WEBOOK_TOKEN);
@taniarascia
taniarascia / auth.md
Last active February 11, 2024 23:16
JavaScript Authentication & Authorization Book/Course

Authentication in Real-World Web Apps with JavaScript

Outline of ideas, concepts to cover, potential projects to write.

Setup Idea

  • Book with a video for each chapter.

Prerequisites/Overview

@mmaday
mmaday / s3-get.sh
Last active April 2, 2024 06:46 — forked from jpillora/s3get.sh
S3 signed GET in plain bash (Requires openssl and curl)
#!/usr/bin/env bash
#
# Usage:
# s3-get.sh <bucket> <region> <source-file> <dest-path>
#
# Description:
# Retrieve a secured file from S3 using AWS signature 4.
# To run, this shell script depends on command-line curl and openssl
#
# References:
@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)
@loranmutafov
loranmutafov / iframe.commands.js
Last active January 9, 2024 19:18
Cypress command to wait for iframes to load
/**
* Will check if an iframe is ready for DOM manipulation. Just listening for the
* load event will only work if the iframe is not already loaded. If so, it is
* necessary to observe the readyState. The issue here is that Chrome initialises
* iframes with "about:blank" and sets their readyState to complete. So it is
* also necessary to check if it's the readyState of the correct target document.
*
* Some hints taken and adapted from:
* https://stackoverflow.com/questions/17158932/how-to-detect-when-an-iframe-has-already-been-loaded/36155560
*
@tpiros
tpiros / robbyrussell.zsh-theme
Created November 1, 2019 10:39
Adding emojis to ZSH theme
# On a Mac: /Users/<username>/.oh-my-zsh/custom/themes
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
local emojis=("👋" "🤡" "🦄" "🤙" "🐼" "😊" "🔥" "⚡" "😎" "🌎")
local selectedEmoji=${emojis[$[1+($RANDOM%${#emojis[@]})]]}
local today=$(date +%m.%d)
# local ipCountry=`curl -s ip-api.com/json | python -c "import sys, json; print json.load(sys.stdin)['country']"`
# local country=$emoji_flags[${ipCountry}]
# }
case $today in
"01.01")
@webpro
webpro / 1_runner.js
Last active May 26, 2019 19:00
Minimal test runner that covers most of your needs
const util = require('util');
const result = title => err => {
if (err instanceof Error) {
console.log(`✖ ${title}`);
console.error(err.actual || err);
} else {
console.log(`✔ ${title}`);
}
};
@crtr0
crtr0 / TypeText.js
Last active March 25, 2019 16:59
React component for typing out words (uses Hooks)
import { useState, useEffect } from 'react'
// wordList is expected to be an array
const TypeText = ({ wordList }) => {
const words = wordList
const [text, setText] = useState(null)
let wordIndex = 0
let typingIndex = 0
let timer