Skip to content

Instantly share code, notes, and snippets.

View acareaga's full-sized avatar

Aaron Careaga acareaga

View GitHub Profile
<script lang="ts">
import { useIntersectionObserver } from "@vueuse/core";
import { ref, nextTick } from "vue";
function onIdle(cb = () => {}) {
if ("requestIdleCallback" in window) {
window.requestIdleCallback(cb);
} else {
setTimeout(() => {
nextTick(cb);
@mrodal
mrodal / InfiniteScroll.vue
Created February 14, 2021 15:27
Vuetify Infinte Scroll Component
<template>
<div>
<div v-for="(item, i) in items" :key="i" v-intersect="onIntersect" :data-last="i === items.length - 1">
<slot :item="item"></slot>
</div>
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
@mayneyao
mayneyao / notion2blog.js
Last active July 19, 2024 02:12
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
@ttrahan
ttrahan / block_personal_appts
Last active July 9, 2024 20:46
Google Apps Script to automatically create, edit and delete events on work calendar for personal calendar events. Instructions on how to set up can be found at https://medium.com/@willroman/auto-block-time-on-your-work-google-calendar-for-your-personal-events-2a752ae91dab
function sync() {
var id="XXXXXXXXXX"; // CHANGE - id of the secondary calendar to pull events from
var today=new Date();
var enddate=new Date();
enddate.setDate(today.getDate()+7); // how many days in advance to monitor and block off time
var secondaryCal=CalendarApp.getCalendarById(id);
var secondaryEvents=secondaryCal.getEvents(today,enddate);
@mvarela
mvarela / binVis2d.r
Created September 9, 2017 09:38
This is the code used in my blog post about binary data visualization. Feel free to use it as you see fit.
library(tidyverse)
# binviz Veles-like binary visualizaiton
binViz2d <- function(filename, alpha = 1/100, maxsize = 5000000,
save = TRUE, polar = FALSE, sample = FALSE,
sample_size = 2000000, do_density = FALSE){
# setting dens_plot as NA simplifies the logic below a bit
dens_plot = NA
@gagarine
gagarine / install-clamav-osx.md
Last active June 10, 2024 15:36
Howto Install clamav on OSX with brew

Howto Install clamav on OSX with brew

Note: on legacy intel system the path may be /usr/local/etc/clamav instead of /opt/homebrew/etc/clamav/

$ brew install clamav
$ cd /opt/homebrew/etc/clamav/
$ cp freshclam.conf.sample freshclam.conf
@tzmartin
tzmartin / embedded-file-viewer.md
Last active July 9, 2024 10:23
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@cvan
cvan / HOWTO.md
Last active May 16, 2024 00:00
How to serve a custom HTTPS domain on GitHub Pages with CloudFlare: *FREE*, secure and performant by default

Instructions

CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.

  1. Make sure you have registered a domain name.
  2. Sign up for CloudFlare and create an account for your domain.
  3. In your domain registrar's admin panel, point the nameservers to CloudFlare's (refer to this awesome list of links for instructions for various registrars).
  4. From the CloudFlare settings for that domain, enable HTTPS/SSL and set up a Page Rule to force HTTPS redirects. (If you want to get fancy, you can also enable automatic minification for text-based assets [HTML/CSS/JS/SVG/etc.], which is a pretty cool feature if you don't want already have a build step for minification.)
  5. If you
@jasonpilz
jasonpilz / VPS Setup.md
Last active July 4, 2019 09:49
Getting a VPS set up

Mission

  • Setup for a new DigitalOcean/AWS EC2/Linode server.

Software we need on the VPS

sudo apt-get update
sudo apt-get install htop 
sudo apt-get install tmux 

sudo apt-get install vim