Skip to content

Instantly share code, notes, and snippets.

View brandonb927's full-sized avatar

Brandon Brown brandonb927

View GitHub Profile
@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
@NicholasBoll
NicholasBoll / addContext.js
Created December 16, 2018 08:34
Cypress mochawesome report. All files go into `cypress` directory
const addContext = (report, screenshots, videoUrl) => {
const getTests = t => t.tests
const getSuites = t => t.suites
const addSuiteContext = (suite, previousTitles = []) => {
const titles = suite.title ? previousTitles.concat(suite.title) : previousTitles
getTests(suite).forEach(test => {
test.timedOut = false // for some reason this is dropped
const context = [
{
@bchecketts
bchecketts / placeFileInAllGithubRepos.php
Last active March 8, 2022 17:07
Quick script to place a single file in every repository in your Github organization
<?php
## Generate a Github user token at https://github.com/settings/tokens
$githubToken = 'EnterYourGithubTokenHere';
## Your organization name (from https://github.com/yourOrganizationName)
$organization = 'yourOrganizationName';
## Enter the name of the remote file you want to place
$remoteFile = "pull_request_template.md";
# This is a blocklist to block samsung smart tv's sending meta data at home.
# Please help to collect domains!
# It could be that the TV does not receive any more updates or other services no longer work. Please report such an incident.
abtauthprd.samsungcloudsolution.com
acr0.samsungcloudsolution.com
ad.samsungadhub.com
ads.samsungads.com
amauthprd.samsungcloudsolution.com
api-hub.samsungyosemite.com

Useful VSCode shortcuts

  • Navigate to a symbol in a file - ⌘O (add ":" to group by type)
  • Navigate to a symbol in a project - ⌘T (#)
  • Select line - ⌘I
  • Zen Mode - ⌘K+Z
  • Hide sidebar - ⌘B
  • Open markdown preview - ⌘K+V
  • Go to source file - ⌘ Click
  • Toggle terminal - ⌃`
@cjLGH
cjLGH / README.md
Last active November 26, 2022 15:46
Radarr Automated Install

Automated Install (Radarr)

Save As: radarr_install.sh
Run Command: sudo ./radarr_install.sh

@remy
remy / _README.md
Last active July 25, 2018 16:27
User style sheet to put the README in the right place.

README first for github

Using a user style sheet extension, this CSS should give you enough targetting to put the README above the files, putting the important information in the right place.

I use uptight, by the late Chloe Weil, you can use what you want.

example