Skip to content

Instantly share code, notes, and snippets.

View jecfish's full-sized avatar

Jecelyn Yeen jecfish

View GitHub Profile
<!-- app.component.html -->
<my-top-bar (reset-clicked)="resetGame()"></my-top-bar>
<my-top-message [time]="currentTime"></my-top-message>
<my-cards [cards]="cards" (card-flipped)="startGame()" (all-cards-matched)="stopGame()"></my-cards>
<my-pop-up-modal *ngIf="isGameCompleted" [time]="currentTime" (reset-clicked)="resetGame()"></my-pop-up-modal>
// app.component.ts
import { Component, OnInit } from '@angular/core';
import * as shuffle from 'lodash/fp/shuffle';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
// app.component.ts
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; // add this line
// ...
@NgModule({
declarations: [
// ...
schemas: [CUSTOM_ELEMENTS_SCHEMA], // add this line
})
export class AppModule { }
@jecfish
jecfish / Test WebP Support
Created May 20, 2020 11:38
Test WebP Support
/* test webp support, add .webp class to body */
{
canvas = typeof document === 'object' ?
document.createElement('canvas') : {};
canvas.width = canvas.height = 1;
if (canvas.toDataURL && canvas.toDataURL('image/webp').indexOf('image/webp') === 5) {
document.querySelector('body').classList.add('webp')
}
}
@jecfish
jecfish / cucukmyaz.js
Last active June 6, 2021 12:51
Prefill for AstraZeneca vaccination
const gid = (id) => document.getElementById(id);
gid('idtype').value = "1"; // 1=IC
gid('nric').value = "Replace_your_IC"; // e.g. 901231032468
gid('ic-numbern').value = "Replace_your_IC"; // e.g. 901231032468
checkic();
gid('msid').value = "Replace_your_MySejahteraID"; // your phone or email
gid('phone').value = "Replce_your_phone";
gid('phone-numbern').value = "Replace_your_phone";
boxclickppv('kl'); // or replace with "selangor"
@jecfish
jecfish / pptr-text-selector.js
Last active October 15, 2022 21:37
Puppeteer Text Selector
import puppeteer from 'puppeteer';
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://developer.chrome.com/blog/extend-recorder/');
// Use unique text as selector
// It's not neccessary to specify full text in the selector