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({ |
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"> |
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++) { |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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"])') |
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. |
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 { AfterViewInit, ChangeDetectorRef, Directive, Input, Renderer2, SimpleChanges } from '@angular/core'; | |
@Directive({ | |
selector: '[appPopoverPositionalClass]' | |
}) | |
export class PopoverPositionalClassDirective implements AfterViewInit { | |
@Input() originY: string; | |
@Input() targetSelector: string; | |
@Input() inverseClass; | |
@Input() initialDirection = 'bottom'; |
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
/* You can add global styles to this file, and also import other style files */ | |
.cdk-overlay-container { | |
display: block; | |
&.z-index-top { | |
z-index: 2050; | |
} | |
} | |
.duplicate-modal-overlay { |
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
<!-- USAGE --> | |
<!-- Transoforming strings --> | |
<div class="users"> | |
<div class="users__user" *ngFor="let user of users"> | |
{{user.name | appTitleCase}} | |
</div> | |
</div> | |
<!-- Transforming Arrays --> |
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
function evaluatePrice(vehicle: Vehicle) { | |
switch(vehicle.vType) { | |
case "car": | |
return vehicle.transmission * evaluationFactor; | |
case "truck": | |
return vehicle.capacity * evaluationFactor; | |
case "motorcycle": | |
return vehicle.make * evaluationFactor; | |
case "bicycle": | |
return vehicle.make * evaluationFactor; |