Skip to content

Instantly share code, notes, and snippets.

View GuiMarthe's full-sized avatar

Guilherme Marthe GuiMarthe

View GitHub Profile
@GuiMarthe
GuiMarthe / compinit.zsh
Created January 2, 2023 15:34 — forked from ctechols/compinit.zsh
Speed up zsh compinit by only checking cache once a day.
# On slow systems, checking the cached .zcompdump file to see if it must be
# regenerated adds a noticable delay to zsh startup. This little hack restricts
# it to once a day. It should be pasted into your own completion file.
#
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.
autoload -Uz compinit
@GuiMarthe
GuiMarthe / validateType.js
Created January 2, 2023 14:30 — forked from Nick-Gabe/validateType.js
Validate types of an object or value based on expected result.
function validateType(expected, input) {
if (!input) return false;
// maps verifications for standard types and custom classes
const typeVerifier = {
Object: (x) => typeof x === 'object' &&
!Array.isArray(x) &&
x !== null,
String: (x) => typeof x === 'string',
Number: (x) => typeof x === 'number',
@GuiMarthe
GuiMarthe / README.md
Created December 12, 2022 18:25 — forked from elalemanyo/README.md
Debug zsh startup time

Debug zsh startup time

  1. Inject profiling code

    At the beginning of your .zshrc add following: zmodload zsh/zprof

    and at the end add: zprof

    This will load zprof mod and display what your shell was doing durung your initialization.

import pandas as pd
import datetime
from datetime import datetime as dt
from dateutil.relativedelta import *
class TimeBasedCV(object):
'''
Parameters
----------
train_period: int