This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check if a filename was provided | |
if [ $# -eq 0 ]; then | |
echo "Error: Please provide a C source file name." | |
echo "Usage: $0 <filename.c>" | |
exit 1 | |
fi | |
# Store the input filename |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createAppAuth } from "npm:@octokit/auth-app"; | |
import { Octokit } from "npm:@octokit/rest"; | |
import { serve } from "https://deno.land/std/http/server.ts"; | |
import { ContentType } from "npm:@octokit/types"; | |
// Configuration | |
const APP_ID = Deno.env.get("GITHUB_APP_ID") || ""; | |
const PRIVATE_KEY = Deno.env.get("GITHUB_PRIVATE_KEY") || ""; | |
const INSTALLATION_ID = Deno.env.get("GITHUB_INSTALLATION_ID") || ""; | |
const OWNER = Deno.env.get("REPO_OWNER") || ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ENCRYPTION_KEY: any = 'your-encryption-key-here' // Must be 256 bits (32 characters) || Please use the above created shared key | |
const SharedKey = () => { | |
if (ENCRYPTION_KEY instanceof CryptoKey) return ENCRYPTION_KEY | |
return window.crypto.subtle.importKey( | |
'raw', | |
new TextEncoder().encode(ENCRYPTION_KEY), | |
'AES-GCM', | |
false, | |
['encrypt', 'decrypt'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs from 'fs' | |
import PDFParser from "pdf2json"; | |
import { parseAsync } from 'json2csv' | |
const BillsTotal = [] | |
const [_, __, path, portal] = process.argv | |
const config = { | |
amount: portal === 'zomato' ? "Total" : "Invoice%20Total", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Stack { | |
constructor(val) { | |
if (!val) { | |
throw new Error('Please set the max for the stack') | |
} | |
this.max = val | |
this.__data__ = [] | |
} | |
get __isFull() { | |
return this.__data__.length == (this.max - 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node { | |
constructor(val) { | |
this.prev = null | |
this.val = val | |
this.next = null | |
} | |
} | |
class LinkedList { | |
constructor() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Date.now().toString(36) + Math.random().toString(36).substring(2,10) | |
// Another way | |
crypto.randomUUID() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BetterMap { | |
constructor(init) { | |
this.clear() | |
if (init) | |
for (var i = 0; i < init.length; i++) | |
this.set(init[i][0], init[i][1]) | |
} | |
clear() { | |
this._map = {} | |
this._keys = [] |
This repo used to be a simple cookbook but I decided to convert this repo into "ProseMirror for dummies". In part because I wil most likely forget all the info written here, and in part because I'd like to help you, dear reader, in your struggle to use this library which is not for the faint of heart.
This is a work in progress. If you have any suggestion, please do not hesitate to create an issue or a PR.
Also, check the ProseMirror Utils repo by Atlassian. Not only it is useful per se, but the source code offers a lot of information on how to to certain things.
NewerOlder