This file contains 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
import { Breakpoint, useMediaQuery, useTheme } from "@mui/material"; | |
/** | |
xs, extra-small: 0px | |
sm, small: 600px | |
md, medium: 900px | |
lg, large: 1200px | |
xl, extra-large: 1536px | |
*/ | |
export function useGetMuiBreakPointLabel(): Breakpoint { |
This file contains 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
console // match start | |
.log // match end | |
console.log console.log // 2 matches | |
console .log // match | |
console. // match start | |
log // match end | |
asdf | |
asdf | |
console.log // match | |
asdf |
This file contains 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/bash | |
# takes in a file as argument 1 | |
# takes in a boolean as argument 2 | |
count_and_print_logs_in_file() { | |
file=$1 | |
print_logs_found_on_lines=false | |
if [ $# -gt 1 ]; then | |
print_logs_found_on_lines=$2 | |
fi |
This file contains 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
/** | |
* returns a promise which when resolves returns the duration of the audio in milliseconds or | |
* rejects with the value if something goes wrong | |
*/ | |
export function getDurationOfAudioInMilliseconds(src: string): Promise<number> { | |
return new Promise((resolve, reject) => { | |
var audio = new Audio(); | |
audio.addEventListener("loadedmetadata", function () { | |
if (audio.duration) { |
This file contains 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 has been tested on mac bash/terminal | |
# test valid input argument (directory path) | |
echo "ths is arg #: $#" | |
if [ $# -eq 0 ]; then | |
echo "no directory to search from supplied" |
This file contains 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 has been tested on mac bash/terminal | |
# test valid input argument (directory path) | |
if [ $# -eq 0 ]; then | |
echo "no directory to search from supplied" | |
exit 1 | |
else |
This file contains 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
function increaseFreq(osc, nOfTimesToIncreaseFreq, delayInSeconds, riseInFrequency){ | |
for(let i = 0; i < nOfTimesToIncreaseFreq; i++){ | |
osc.frequency.setValueAtTime(200 + (i*riseInFrequency) , audioCtx.currentTime + (i * delayInSeconds)); // value in hertz | |
} | |
} | |
const audioCtx = new (window.AudioContext || window.webkitAudioContext)(); | |
// create Oscillator node | |
const oscillator = audioCtx.createOscillator(); |
This file contains 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
interface Observer<ObservableClass, ObservableEventEnum>{ | |
update: (ObjectRef: ObservableClass, observableEventEnum: ObservableEventEnum) => void; | |
} | |
class Observable<ObservableClass, ObservableEventEnum>{ | |
observers: Observer<ObservableClass, ObservableEventEnum>[]; | |
constructor(){ | |
this.observers = []; | |
} |
This file contains 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
// rock paper scissors business logic/application state/model data | |
enum Hand{ | |
ROCK, | |
PAPER, | |
SCISSORS | |
} | |
const hands = [Hand.ROCK, Hand.PAPER, Hand.SCISSORS]; |
NewerOlder