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 os | |
input_song = "./songs/Wade.aif" | |
output_path = "./output" | |
def convert_to_ogg_vorbis(src, out_path): | |
# Load the audio file | |
audio = AudioSegment.from_file(src) |
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
// contracts/NFT.sol | |
// SPDX-License-Identifier: MIT OR Apache-2.0 | |
pragma solidity ^0.8.3; | |
import "@openzeppelin/contracts/utils/Counters.sol"; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
import "hardhat/console.sol"; |
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
{ | |
"apps": [ | |
{ | |
/* General */ | |
"name": "my-api", /* (string) application name (default to script filename without extension) */ | |
"script": "index.js", /* (string) script path relative to pm2 start */ | |
"cwd": "/var/www/", /* (string) the directory from which your app will be launched */ | |
"args": "-a 13 -b 12", /* (string) string containing all arguments passed via CLI to script */ | |
"interpreter": "/usr/bin/python", /* (string) interpreter absolute path (default to node) */ | |
"interpreter_args": "--harmony", /* (string) option to pass to the interpreter */ |
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 cookie from './cookie'; | |
import { configs } from './configs'; | |
export type RegCodeOptions = { | |
deviceId: string; | |
isRegister?: boolean; | |
isMVPD?: boolean; | |
selectedMvpdId?: string; | |
}; |
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 GENRES = [ | |
{ key: 'chill', query: 'chill house' }, | |
{ key: 'deep', query: 'deep house' }, | |
{ key: 'dubstep', query: 'dubstep' }, | |
{ key: 'house', query: 'house' }, | |
{ key: 'progressive', query: 'progressive house' }, | |
{ key: 'tech', query: 'tech house' }, | |
{ key: 'trance', query: 'trance' }, | |
{ key: 'tropical', query: 'tropical house' }, | |
]; |
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 formData = new FormData(SomeFormElement); | |
let jsonObject = {}; | |
for (const [key, value] of formData.entries()) { | |
jsonObject[key] = value; | |
} |
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 color = 'fffff' | |
let newColor = '' | |
if (!color.includes('#')) { | |
newColor = insert(color, 0, "#") | |
} | |
function insert(str, index, value) { |
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 Sandwich(name) { | |
this.name = name; | |
} | |
Sandwich.prototype.eat = function () { | |
console.log("I'm eating " + this.name); | |
} | |
function Subway () { | |
Sandwich.call(this, 'subway'); |
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
'use strict'; | |
(function () { | |
'use strict' | |
const _ = { // Selector and EventListener Util | |
qs: function (selector, scope) { return (scope || document).querySelector(selector) }, | |
qsa: function (selector, scope) { return (scope || document).querySelectorAll(selector) }, | |
crEl: function (selector, scope) { return (scope || document).createElement(selector) }, | |
evt: function (evt, target, callback, useCapture) { target.addEventListener(evt, callback, !!useCapture) }, |
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 _ = {} | |
(function (_) { | |
_.arrayFrom = function (iterable) { | |
if (Array.from) return Array.from(iterable) | |
return Array.prototype.slice.call(iterable) | |
} | |
_.pipe = function () { |
NewerOlder