Skip to content

Instantly share code, notes, and snippets.

View thisjt's full-sized avatar
🦄

Joshua Tahanlangit thisjt

🦄
View GitHub Profile
@thisjt
thisjt / vite.config.js
Last active June 9, 2024 19:20
Vite Plugin - Git Unstaged Files Checker
/*
I've always hated being a bit too in the zone during coding
only to know that I've written too many lines of code before a commit.
This plugin makes sure that I'm always in check of around how
many lines of code I've made/modified and commit them when needed.
*/
import { defineConfig } from 'vite';
import { exec } from 'child_process';
@thisjt
thisjt / Dropbox File Uploader.js
Created July 1, 2023 07:23
Function to Upload a (Zip) File to Dropbox
var Dropbox = require('dropbox').Dropbox
var accessToken = '##ACCESSTOKEN##'
var filename = 'fileToUpload.zip'
fs.readFile(filename, (err, data) => {
if(err) {
// handle error
return
}
(new Dropbox({ accessToken: accessToken })).filesUpload({
@thisjt
thisjt / Google Drive File Downloader.js
Created June 29, 2023 21:09
Function to Download a File from Google Drive
const keys = require('./auth.json')
const fs = require('fs')
const {JWT} = require('google-auth-library')
const {drive} = require('googleapis/build/src/apis/drive')
// DELETE ALL FILES in "apis" folder except "drive" to slim down "googleapis" file size
function downloadFileToGdrive() {
const auth = new JWT({
@thisjt
thisjt / Google Drive File Uploader.js
Created June 29, 2023 21:05
Function to Upload a (Zip) File to Google Drive
const keys = require('./auth.json')
const fs = require('fs')
const {JWT} = require('google-auth-library')
const {drive} = require('googleapis/build/src/apis/drive')
// DELETE ALL FILES in "apis" folder except "drive" to slim down "googleapis" file size
function uploadFileToGdrive() {
const auth = new JWT({