View api.test.ts
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 {describe, expect, test} from '@jest/globals'; | |
import * as API from './api'; | |
import fetch from 'jest-mock-fetch'; | |
describe('api module', () => { | |
test('addProp should add bootcamp', async () => { | |
/** | |
* spying on the fetchUser method to check if it is called | |
* by addProp | |
* we're also mocking a return value from the fetchUser |
View javascript-questions.json
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
[ | |
{ | |
"question":"Which is the purpose of JavaScript?", | |
"answers":{ | |
"1":"To style HTML Pages", | |
"2":"To add interactivity to HTML pages", | |
"3":"To perform server side scripting operations" | |
}, | |
"correctAnswerId":"2", | |
"id":"1" |
View solid-js-tutorial-snippets-part-2.json
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
[ | |
{ | |
"created": "2022-11-21T23:25:28.008Z", | |
"name": "sjs-request-page-index", | |
"tags": [ | |
"sjs-request-page-index" | |
], | |
"content": "import { Component } from \"solid-js\";\n\nconst RequestIndex: Component = () => {\n return (\n <div class=\"flex flex-col md:flex-row gap-4 justify-center items-center bg-gray-200 p-4 border border-gray-300 min-h-full rounded-lg\">\n <div class=\"text-2xl flex gap-4 items-center\">\n <ion-icon class=\"text-4xl\" name=\"arrow-back-circle-outline\"></ion-icon>\n <span>Select a request from the left panel</span>\n </div>\n </div>\n );\n};\n\nexport default RequestIndex;", | |
"contentType": "typescriptreact" | |
}, |
View index.html
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
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Express</title> | |
<link rel="stylesheet" href="/stylesheets/style.css"> | |
<script src="https://cdn.tailwindcss.com"></script> | |
<style> | |
html, body { |
View score.validators.js
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 joi = require('joi') | |
const createHttpError = require('http-errors') | |
const addScoreDTO = joi.object().keys({ | |
gameId: joi.string().required(), | |
userId: joi.string().required(), | |
score: joi.number().required(), | |
}); | |
const deleteScoreDTO = joi.object({ |
View sigma-memer-tailwind-template.html
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
<div class="h-full leading-normal tracking-normal text-indigo-400"> | |
<div class="p-6 container mx-auto"> | |
<div class="w-full flex items-center justify-between"> | |
<a class="flex items-center text-indigo-400 no-underline hover:no-underline font-bold text-2xl lg:text-4xl" href="#"> | |
Sigma<span class="bg-clip-text text-transparent bg-gradient-to-r from-green-400 via-pink-500 to-purple-500">memer</span> | |
</a> | |
</div> | |
</div> | |
<div class="px-6 container md:pt-224 mx-auto flex flex-wrap flex-col md:flex-row items-start"> |
View appflashback-hack.js
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
// run this when the round starts | |
const emojiElements = document.querySelectorAll(".card-inner"); | |
const matchedElementIndices = []; | |
const matches = []; | |
for(let i = 0, len = emojiElements.length; i<len; i++) { | |
const currentElement = emojiElements[i]; | |
if(matchedElementIndices.includes(i)) { | |
continue; | |
} | |
for(let j = i + 1; j < len; j++) { |
View hangman.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View fb-friend-requests-automation.js
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
/** | |
* @author Muhammad Ahsan Ayaz | |
* Usage: | |
* Go to https://www.facebook.com/friends/requests/ | |
* Run the following code | |
*/ | |
function removeFriendRequest({row, removeRequests, counter, timerDelay}) { | |
if (removeRequests) { | |
const removeButton = row.closest('a').querySelector('[aria-label="Remove"]:not([aria-disabled="true"])') |
View Code.gs
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
/** | |
Replace the "<DOCID>" with your document ID, or the entire URL per say. Should be something like: | |
var EMAIL_TEMPLATE_DOC_URL = 'https://docs.google.com/document/d/asdasdakvJZasdasd3nR8kmbiphqlykM-zxcrasdasdad/edit?usp=sharing'; | |
*/ | |
var EMAIL_TEMPLATE_DOC_URL = 'https://docs.google.com/document/d/<DOCID>/edit?usp=sharing'; | |
var EMAIL_SUBJECT = 'This is an important email'; | |
/** | |
* Sends a customized email for every response on a form. |
NewerOlder