Skip to content

Instantly share code, notes, and snippets.

View michaellarrubis's full-sized avatar
👋

Michael Larrubis michaellarrubis

👋
View GitHub Profile
@michaellarrubis
michaellarrubis / pr-checklist.md
Created July 3, 2024 05:24 — forked from katyhuff/pr-checklist.md
Pull Request Review Checklist
  • Read the PR description
  • Read through all the changes, considering the following questions.
    • Is there anything you can praise about this PR? Start with praise.
    • Are variable names brief but descriptive?
    • Are new/changed functions no longer than a paragraph?
    • Do all function parameters have default values where appropriate?
    • Is the code clear and clean? (see Robert C. Martin's Clean Code)
    • Is there enough documentation?
  • Does the programming style meet the requirements of the repository (PEP8 for python, google for c++, etc.)
// useDebounce.js
import { useEffect } from 'react'
import useTimeout from './useTimeout'
const useDebounce = (callback, delay, dependencies) => {
const { reset, clear } = useTimeout(callback, delay)
useEffect(reset, [...dependencies, reset])
useEffect(clear, [])
}
/* eslint-disable @typescript-eslint/no-unused-vars */
import { VuexModule, Module, Action, Mutation } from 'vuex-module-decorators';
import { $axios } from '@/utils/api';
import { store } from '@/store/store';
import { deepCopy, getErrorData } from '@/utils/functions';
import { API_PATH, CONTENT_TYPE_HEADER } from '@/constants/apiConstants';
import {
UserDictionary,
GetUserDictionariesResponse,
@michaellarrubis
michaellarrubis / plugin-facebook.rb
Last active February 25, 2020 04:41
plugin-facebook.rb
# Helper
# Getting Page Posts
def get_page_posts
check_fb_plugin_installed = ActiveRecord::Base.connection.data_source_exists? 'plugins_facebook_sns'
fb_plugin = current_site.plugins.where(slug: 'facebook_sn')
status = fb_plugin[0]['status'].to_i
return false if !check_fb_plugin_installed
return false if !fb_plugin.present?
return false if status == 0
@michaellarrubis
michaellarrubis / bookings.js
Last active February 25, 2020 04:42
bookings.js
import axios from 'axios'
import { getField, updateField } from 'vuex-map-fields'
import moment from 'moment'
import _ from 'lodash'
function formatDate(date) {
// 15 Feb 2018
if (date){
let year = moment(date).format('YYYY')
let day = moment(date).format('D')