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
# display one audio waveform in time domain | |
def plot_waveform(audio_file_path): | |
# # Your code goes here (do not change the function definition) | |
plt.figure(figsize=(12, 4)) | |
waveform, sample_rate = librosa.load(audio_file_path, sr=None) | |
librosa.display.waveshow(waveform, sr=sample_rate, color="orange") | |
plt.title("Waveform of " + str(audio_file_path.split("/")[-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
import i18n from "i18next"; | |
import { initReactI18next } from "react-i18next"; | |
import en from "./translations/en/translations.json"; | |
import malay from "./translations/malay/translations.json"; | |
export const resources = { | |
English: { | |
translation: en, | |
}, | |
Malay: { | |
translation: malay, |
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
let randomFileName = uuidv4() + '.' + req.file.originalname.split('.')[req.file.originalname.split('.').length - 1]; | |
let filename = req.file.originalname; | |
sharp(req.file.buffer) | |
.jpeg({ | |
quality: 30, | |
}) | |
.withMetadata() | |
.rotate() | |
.toBuffer() | |
.then((data) => { |
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
const { isLoaded } = useJsApiLoader({ | |
id: "google-map-script", | |
googleMapsApiKey: process.env.REACT_APP_GOOGLE_MAPS_API_KEY, | |
libraries, | |
}); | |
{loading || !isLoaded ? ( | |
<Center | |
h="80vh" | |
flexDirection="column" | |
justifyContent="center" |
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
// eslint-disable-next-line no-unused-vars | |
var CACHE_NAME = "pwa-task-manager"; | |
// eslint-disable-next-line no-unused-vars | |
var urlsToCache = []; | |
// eslint-disable-next-line no-unused-vars | |
self.addEventListener("install", function (e) { | |
self.skipWaiting(); | |
}); |
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
import { createSlice } from "@reduxjs/toolkit"; | |
import cookie from "js-cookie"; | |
| |
export const authSlice = createSlice({ | |
name: "auth", | |
initialState: { | |
user: | |
cookie.get("user") !== undefined ? JSON.parse(cookie.get("user")) : {}, | |
isAuthenticated: cookie.get("accessToken") ? true : false, | |
accessToken: cookie.get("accessToken") ? cookie.get("accessToken") : "", |