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
const fs = require('fs'); | |
const path = require('path'); | |
// Define the directory containing the SVG files | |
const svgDirectory = './flags'; | |
function dashedToCamelCase(input) { | |
return input.replace(/-([a-z])/g, function(match, letter) { | |
return letter.toUpperCase(); | |
}); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Redux-like State Management</title> | |
</head> | |
<body> | |
<button id="updateButton" onclick="actionUpdateButton()">Update State</button> | |
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
const Interaction = (id) => { | |
return ` | |
<div class="interactive-section" id="interactive-section-${id}"> | |
<button class="click-me-button" onclick="displayMessage(${id})">Click Me!</button> | |
<p class="output-message"></p> | |
</div> | |
<script> | |
function displayMessage(id) { | |
const outputMessage = document.querySelector('#interactive-section-' + id + ' .output-message'); |
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
let | |
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-23.11"; | |
pkgs = import nixpkgs { config = { allowUnfree = true; }; overlays = []; }; | |
git = pkgs.git.overrideAttrs (oldAttrs: rec { | |
version = "2.42.0"; | |
}); | |
podman = pkgs.podman.overrideAttrs (oldAttrs: rec { | |
version = "4.7.2"; |
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
const getLastDays = (day) => Array.from({ length: day }, (_, i) => new Date(Date.now() - i * 24 * 60 * 60 * 1000)); |
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
label { | |
margin-bottom: 0.5rem; | |
} |
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
from pydub import AudioSegment | |
import uuid | |
import librosa | |
import numpy as np | |
import os | |
BASE_FOLDER = './dir/' | |
FILE = 'Saron_mono_1.wav' | |
file_path = os.path.join(BASE_FOLDER, FILE) |
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 os | |
from pydub import AudioSegment | |
DIRECTORY = './your_directory' | |
LIST_DIR = os.listdir(DIRECTORY) | |
for filename in sorted(LIST_DIR): | |
if filename.endswith('.wav'): | |
sound = AudioSegment.from_wav(DIRECTORY + "/" + filename) | |
sound = sound.set_channels(1) |
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 React from 'react'; | |
import { shallow } from 'enzyme'; | |
import ContainerName from '#containers/ContainerName'; | |
describe('<ContainerName />', () => { | |
let wrapper; | |
beforeEach(() => { | |
wrapper = shallow(<ContainerName />); | |
}); | |
afterEach(() => { |
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 { fromJS } from 'immutable'; | |
import { | |
... | |
} from '#src/containers/ContainersName/selectors'; | |
import { initialState } from '#src/containers/ContainersName/reducer'; | |
let mockReduxData; | |
jest.mock('reselect', () => ({ | |
createSelector: (fn, fn2) => { |
NewerOlder