Skip to content

Instantly share code, notes, and snippets.

View justyn-clark's full-sized avatar
🌬️

Justyn Clark justyn-clark

🌬️
View GitHub Profile
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)
@justyn-clark
justyn-clark / NFT.sol
Created March 6, 2022 22:44 — forked from dabit3/NFT.sol
Basic NFT Smart Contract
// 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";
@justyn-clark
justyn-clark / ecosystem.json
Created January 18, 2022 07:01 — forked from wirwolf/ecosystem.json
pm2 ecosystem.json config example
{
"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 */
@justyn-clark
justyn-clark / profile.ts
Created July 29, 2021 20:55
Profile TS Example
import cookie from './cookie';
import { configs } from './configs';
export type RegCodeOptions = {
deviceId: string;
isRegister?: boolean;
isMVPD?: boolean;
selectedMvpdId?: string;
};
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' },
];
const formData = new FormData(SomeFormElement);
let jsonObject = {};
for (const [key, value] of formData.entries()) {
jsonObject[key] = value;
}
let color = 'fffff'
let newColor = ''
if (!color.includes('#')) {
newColor = insert(color, 0, "#")
}
function insert(str, index, value) {
function Sandwich(name) {
this.name = name;
}
Sandwich.prototype.eat = function () {
console.log("I'm eating " + this.name);
}
function Subway () {
Sandwich.call(this, 'subway');
'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) },
const _ = {}
(function (_) {
_.arrayFrom = function (iterable) {
if (Array.from) return Array.from(iterable)
return Array.prototype.slice.call(iterable)
}
_.pipe = function () {