Skip to content

Instantly share code, notes, and snippets.

@jschatz1
jschatz1 / timehelper.js
Last active December 10, 2024 14:39
TimeHelper.js
const TimeHelper = (() => {
const units = [
{ name: 'year', millis: 31536000000 },
{ name: 'month', millis: 2592000000 },
{ name: 'week', millis: 604800000 },
{ name: 'day', millis: 86400000 },
{ name: 'hour', millis: 3600000 },
{ name: 'minute', millis: 60000 },
{ name: 'second', millis: 1000 },
];
use actix_web::{
middleware, web, App, HttpResponse, HttpServer,
};
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
struct Person {
name: String,
number: i32,
}
const svgconfig = require("./svg.config");
const svgo = new SVGO(svgconfig);
@jschatz1
jschatz1 / brandIcon.js
Created September 25, 2019 15:49
Using Bulma: A little branding for your brand inputs
{
getters: {
brandIcon() {
return (text, defaultIcon) => {
const isBrand = brandIcons.includes(text.toLowerCase());
if (isBrand) {
return `fa-${text.toLowerCase()}`;
}
return `fa-${defaultIcon}`;
};
@jschatz1
jschatz1 / gitconfig
Created May 16, 2019 15:45
GitConfig
[alias]
a = add --all
ai = add -i
#############
ap = apply
as = apply --stat
ac = apply --check
#############
ama = am --abort
amr = am --resolved