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
| // let showmoreBtn = $("[data-purpose=\"show-more\"]") | |
| // if (showmoreBtn) showmoreBtn.click() | |
| let expandAllBtn = $("[data-purpose=\"expand-toggle\"]") | |
| if (expandAllBtn) expandAllBtn.click() | |
| let sectionElements = $(".clp-component-render [data-purpose=\"course-curriculum\"] :nth-child(3)").children |
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
| const fs = require("fs"); | |
| const path = require("path"); | |
| const p = path.join(__dirname, "./index.android.bundle") | |
| const file = fs.readFileSync(p, "utf-8"); | |
| var expression = /(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])/gi; | |
| var regex = new RegExp(expression); |
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
| # generate private key | |
| openssl genrsa -out jwtRS256.key 2048 | |
| # extatract public key from it | |
| openssl rsa -in jwtRS256.key -pubout > jwtRS256.key.pub |
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
| const AlphabetsCharacters = | |
| "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; | |
| const NumberCharacters = "0123456789"; | |
| /** | |
| * Creates String of random alphanumeric characters of given length | |
| * @param length | |
| */ | |
| export function makeRandomString(length: number) { | |
| let result = ""; |
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 { useState } from "react"; | |
| const useSetState = <T>( | |
| initialState: T | |
| ): [T, (newState: Partial<T>) => void] => { | |
| const [state, regularSetState] = useState<T>(initialState); | |
| const setState = (newState: Partial<T>) => { | |
| regularSetState(prevState => ({ | |
| ...prevState, |
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
| ## Credits https://gist.github.com/amanjuman/6a40d20be7e04d9986ccca14e4a3d3b4 | |
| sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get autoremove -y | |
| sudo apt-get -y install build-essential wget curl gcc make wget tzdata git libreadline-dev libncurses-dev libssl-dev zlib1g-dev | |
| wget https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases/download/v4.34-9744-beta/softether-vpnserver-v4.34-9744-beta-2020.03.20-linux-x64-64bit.tar.gz | |
| tar xzf softether-vpnserver-v4.34-9744-beta-2020.03.20-linux-x64-64bit.tar.gz && rm softether-vpnserver-v4.34-9744-beta-2020.03.20-linux-x64-64bit.tar.gz | |
| cd vpnserver && sudo make |
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
| type UnExtend<T, K> = Pick<T, Exclude<keyof T, keyof K>>; | |
| declare module "fakingoose" { | |
| import { Model, Document } from "mongoose"; | |
| interface Fakingoose<T> { | |
| generate: () => UnExtend<T, Document> & { _id: string }; | |
| } | |
| function fakingoose<T>(schema: Model<T & Document, {}>): Fakingoose<T>; | |
| export = fakingoose; | |
| } |
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
| <html> | |
| <body> | |
| <h1>Hello {{ firstName }} {{ lastName }}!</h1> | |
| </body> | |
| </html> |
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
| version: "3.3" | |
| services: | |
| db: | |
| image: mysql:latest | |
| container_name: mySql | |
| command: | |
| [ | |
| "--character-set-server=utf8mb4", | |
| "--collation-server=utf8mb4_unicode_ci", | |
| "--default-authentication-plugin=mysql_native_password", |
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
| const { | |
| BlobSASPermissions, | |
| SharedKeyCredential, | |
| generateBlobSASQueryParameters, | |
| } = require("@azure/storage-blob"); | |
| const { | |
| STORAGE_ACCOUNT_KEY, | |
| STORAGE_ACCOUNT_NAME, | |
| CONTAINERS, |