Skip to content

Instantly share code, notes, and snippets.

View rheajt's full-sized avatar
🏠
Working from home

jordan rhea rheajt

🏠
Working from home
View GitHub Profile
@rheajt
rheajt / npm_scripts.lua
Created February 13, 2025 04:01
a quick implementation of the snacks picker to run npm scripts in a tmux sidebar to the right
local function get_npm_scripts()
local file = io.open("package.json", "r")
if file then
local content = file:read("*a")
file:close()
local packageData = vim.json.decode(content)
if packageData.scripts then
local scripts = {}
for key, value in pairs(packageData.scripts) do
-- add key, value to the scripts table
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"entries": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
@rheajt
rheajt / replaceLinks.js
Created August 27, 2020 02:56
[Replace Links] grab a drive link from a spreadsheet and replace it with an embeddable url #gsuite #gas #sheets
@rheajt
rheajt / Code.gs
Created July 29, 2020 03:18
Google Classroom API to Build Classrooms
function main() {
// 1. get the courses from the spreadsheet
const courses = getCoursesFromSpreadsheet();
// 2. create the courses on the classroom
const responses = courses.map((course, ind) => {
const resource = createCourseResource(course);
const response = Classroom.Courses.create(resource);
course[3] = response.alternateLink;
function doGet() {
var html = HtmlService
.createHtmlOutputFromFile('form')
.setSandboxMode(HtmlService.SandboxMode.IFRAME)
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);
return html;
}
function submit(name) {
@rheajt
rheajt / UpdateNamedRanges.ts
Created April 20, 2020 05:32
[UpdateNamedRangs] excel typescript to update the ranges of all named ranges in a workbook #excel #typescript
async function main(context: Excel.RequestContext) {
// Your code here
const items = context.workbook.names.load('items')
await context.sync();
items.items.forEach(item => {
const lastIndex = item.formula.lastIndexOf('$');
const main = item.formula.substring(0, lastIndex + 1);
const split = +item.formula.substring(lastIndex + 1);
@rheajt
rheajt / index.html
Last active August 30, 2021 21:24
[Publish Google Sheet to the Web] easily turn your google sheets into a JSON data source #gaspowered
<ul></ul>
@rheajt
rheajt / Code.gs
Last active December 11, 2019 04:02
[slide data templates] auto-magically pull data from a spreadsheet into a slidedeck #gaspowered
function onOpen() {
SlidesApp.getUi().createMenu('Template')
.addItem('Build template', 'buildTemplate')
.addToUi();
}
function buildTemplate() {
var presentation = SlidesApp.getActivePresentation();
var newPresentation = DriveApp.getFileById(presentation.getId())
.makeCopy('COPY OF TEMPLATE');
@rheajt
rheajt / Code.gs
Last active December 10, 2019 10:15
[Marking Application] old project #gaspowered
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Marking Application')
.addItem('Open App', 'openApp')
.addToUi();
}
function openApp() {
var html = HtmlService.createHtmlOutputFromFile('app');
@rheajt
rheajt / SampleMarkdown.md
Created November 1, 2018 06:37
Sample Markdown

Sample Markdown file

This is going to be a test file for the Office 365 Add-in Tutorial