Skip to content

Instantly share code, notes, and snippets.

View spraddles's full-sized avatar

spraddles

  • Sydney
View GitHub Profile
@spraddles
spraddles / reactExacalidraw.js
Created July 10, 2024 12:55
Excalidraw on Nuxt
// plugins/reactExacalidraw.js
import { createElement } from 'react'
import { createRoot } from 'react-dom/client'
import { Excalidraw } from '@excalidraw/excalidraw'
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.provide('excalidraw', { createElement, createRoot, Excalidraw })
})
@spraddles
spraddles / instagram-api.js
Last active March 1, 2023 05:46
Instagram API for posting a video to a business page
import axios from 'axios'
import dotenv from 'dotenv'
dotenv.config()
export const selfPostInstagram = async (description, tags, date, video) => {
const API = 'https://graph.facebook.com/v16.0'
const INSTAGRAM_BUSINESS_ACCOUNT = process.env.INSTAGRAM_BUSINESS_ACCOUNT
const INSTAGRAM_GRAPH_ACCESS_TOKEN = process.env.INSTAGRAM_GRAPH_ACCESS_TOKEN
@spraddles
spraddles / linkedin-api.js
Last active August 22, 2023 12:15
Linkedin API to create a video post
import axios from 'axios'
import fs, { readFileSync } from 'fs'
import { Blob } from 'buffer'
import { exec } from 'child_process'
import path from 'path'
import stream from 'stream'
import { promisify } from 'util'
import dotenv from 'dotenv'
dotenv.config()