This file contains hidden or 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 | |
rm -rf .git | |
git init | |
git add . | |
git commit -m "[init]: Initialized repo" | |
git branch main | |
git switch main | |
echo "Enter github username: " | |
read username |
This file contains hidden or 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
extension String { | |
func removeChar(character: String) -> String { | |
if(character.count > 1) { | |
print("Only one character can be removed at a time") | |
return "Error occured" | |
} | |
var newStr: String = "" | |
for current in self { | |
if(character == "\(current)"){ |
This file contains hidden or 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 html2canvas from "html2canvas"; | |
import jsPDF from "jspdf"; | |
const exportPDF = () => { | |
const input = document.getElementById("documentID") as HTMLElement; | |
html2canvas(input, { logging: true, useCORS: true }).then((canvas) => { | |
const imgWidth = 290; | |
const imgHeight = 210; | |
const imgData = canvas.toDataURL("img/png"); transform canvas to an image | |
const pdf = new jsPDF("l", "mm", "a4"); // L is landscape, you can use whatever you want for example p to make it portrait |