Skip to content

Instantly share code, notes, and snippets.

// Name: ⌛ Presentation Timer
import '@johnlindquist/kit';
import parse from 'parse-duration';
let timer = await arg(
'Enter duration for timer (e.g. 3 [minutes], 90s, 15m30s)',
);
if (/^\d+$/.test(timer)) {
// Name: Presentation Timer
import '@johnlindquist/kit';
import parse from 'parse-duration';
let timer = await arg(
'Enter duration for timer (e.g. 3 [minutes], 90s, 15m30s)',
);
if (/^\d+$/.test(timer)) {
// Name: Jira Search
import '@johnlindquist/kit';
import { adfConvert } from '../lib/adf-convert';
import { encodeToBase64Node } from '../lib/base64';
import { Jira } from '../lib/jira';
const ATLASSIAN_EMAIL = await env('ATLASSIAN_EMAIL', async () => {
return await arg('Enter your jira email address');
});
// Name: Jira Search
import '@johnlindquist/kit';
import { adfConvert } from '../lib/adf-convert';
import { encodeToBase64Node } from '../lib/base64';
import { Jira } from '../lib/jira';
const ATLASSIAN_EMAIL = await env('ATLASSIAN_EMAIL', async () => {
return await arg('Enter your jira email address');
});
@ryan-nauman
ryan-nauman / jira-search.ts
Created February 1, 2024 21:01
script kit jira search
// Name: Jira Search
import '@johnlindquist/kit';
import { Buffer } from 'buffer';
function adfConvert(node) {
switch (node.type) {
case 'doc':
return node.content.map((node) => adfConvert(node)).join('\n\n');
@ryan-nauman
ryan-nauman / presentation-timer.ts
Created February 1, 2024 18:56
script kit presentation timer
// Name: Presentation Timer
import '@johnlindquist/kit';
import parse from 'parse-duration';
let timer = await arg(
'Enter duration for timer (e.g. 3 [minutes], 90s, 15m30s)',
);
if (/^\d+$/.test(timer)) {
@ryan-nauman
ryan-nauman / open-project.ts
Created February 1, 2024 18:55
script kit open project in vscode
// Name: Open Project
import '@johnlindquist/kit';
import { Dirent } from 'fs';
export type ScriptDir = Dirent & { path: string };
let dir1 = await readdir(home('git/studiox'), { withFileTypes: true });
let dir2 = await readdir(home('git/public'), { withFileTypes: true });
let dirs = [...dir1, ...dir2]
@ryan-nauman
ryan-nauman / gist:3872268
Created October 11, 2012 13:27
Retrying an ajax request supporting error/success callbacks as well as promises
$.ajaxPrefilter(function (options, originalOptions, jqXHR) {
// Don't infinitely recurse
originalOptions._retry = isNaN(originalOptions._retry)
? Common.auth.maxExpiredAuthorizationRetries
: originalOptions._retry - 1;
// set up to date authorization header with every request
jqXHR.setRequestHeader("Authorization", Common.auth.getAuthorizationHeader());
@ryan-nauman
ryan-nauman / gist:3055803
Created July 5, 2012 19:16
Poor c#/js proxy
function jsonProxyDo(jsonDataModel, callback, errorback) {
$.ajax({
type: "POST",
dataType: "json",
url: settings.jsonProxyAddress,
data: $.param({ 'd': JSON.stringify({
'Data': JSON.stringify(jsonDataModel),
'BaseAddress': settings.endpoint,
'ServiceName': 'SomeService.svc/js/',
'MethodName': 'SomeMethod' })