This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# if konsole is not open launch it | |
if [ -z "$(xdotool search --class konsole)" ]; then | |
konsole --tabs-from-file "/home/grayedfox/.config/konsole-tabs" | |
fi | |
# get current focused window and visible konsole window | |
CLASS="konsole" | |
KONSOLE_ID="$(xdotool search --class $CLASS | awk '{print $1}')" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# multiboot iso grub config | |
set timeout=15 | |
set default=0 | |
# (U)EFI Graphic Protocol | |
insmod efi_gop | |
insmod efi_uga | |
insmod font |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ $# -ne 1 ] ; then | |
echo "error: you must pass a single argument that is the file you wish to copy the contents of" | |
exit 1 | |
fi | |
FILE=$1 | |
xclip -selection clipboard < $FILE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# this script assumes you have added an API token via AppCenter and stored it | |
# as an environment variable in your build configuration settings | |
# see https://docs.microsoft.com/en-us/appcenter/test-cloud/frameworks/xcuitest/#build-for-testing | |
# for a better understanding of what's going on | |
SCHEME="schemeOfApplicationUnderTest" | |
APP="appleUserName/appName" | |
DEVICES="appCenterTestDevices" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# please ensure python means python3 on your system | |
# the file can be any binary file that contains a JPG image | |
# note that it's hungry and doesn't chunk the read so careful with large files | |
# usage: extract-jpg file_name | |
import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ $# -eq 1 ] ; then | |
NAME=$1 | |
else | |
echo "Please pass exactly one argument, which is the name of the patch file" | |
exit 1 | |
fi | |
git add . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PRIMITIVES (JavaScript -- 7) | |
// boolean null undefined number string symbol object | |
// FACTORY | |
// The Factory Pattern is a little dated (ES6 classes offer a pretty pain free way of defining classes and using default | |
// constructors with the 'new' keyword) however they do still see some use in modern web development and automation. | |
// Factories can be especially useful when designed to return objects/data structures common to certain test operations | |
// within an automation suite (i.e. mocking an object used to fill out all form fields with valid data). | |
function Car (options) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Calculate Triangle Possibility From Edges | |
// given a set of edges from 0 to N calculate if we can make at least one triangle from them | |
function triangleFromLengths(a) { | |
// the trick here is to sort the edges into ascending order | |
// given a = [10, 2, 5, 1, 8, 20], when sorted, we get [1, 2, 5, 8, 10, 20] | |
// ascending order guarantees that every value that suceedes another is either the same size or greater (A[0] <= A[1]) | |
// this means that if the sum of any two edges preceeding a third is greater than that third (i.e. if 5 + 8 > 10) | |
// the triangle inequality theorem will hold true: https://www.wikihow.com/Determine-if-Three-Side-Lengths-Are-a-Triangle | |
// since: 5 + 8 > 10 && 8 + 10 > 5 && 5 + 10 > 8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// remove the first instance of an item inside an array (extends native array object) | |
if (!Array.prototype.remove) { | |
Array.prototype.remove = function remove (item) { // eslint-disable-line no-extend-native | |
if (!(this || Array.isArray(this))) { | |
throw new TypeError() | |
} | |
if (this.indexOf(item) !== -1) { | |
this.splice(this.indexOf(item), 1) | |
return this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Zap Settings | |
// 1 use GitHub webhooks to send review request notifications to Zapier | |
// 2 apply text filter: action must exactly match "review_requested" | |
// 3 run some JavaScript (i.e. this script) | |
// 4 send a message to a channel (not a direct message), as a bot | |
// 5 use a custom value for the channel ID which takes the output channelId of this script | |
const reviewerName = inputData.reviewer.toLowerCase() | |
const requesterName = inputData.requester.toLowerCase() |
NewerOlder