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
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. | |
// This is a specialised implementation of a System module loader. | |
"use strict"; | |
// @ts-nocheck | |
/* eslint-disable */ | |
let System, __instantiate; | |
(() => { |
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 moment from "https://cdn.pika.dev/moment@^2.26.0"; | |
export function greet(name: string) { | |
return `Hello, Mr./Ms. ${name}`; | |
} | |
export function formattedDate() { | |
const todayMoment = moment(new Date()); | |
const todayFormatted = todayMoment.format("MM/DD/YYYY hh:mm a"); | |
return todayFormatted; | |
} | |
formattedDate() |
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
Serial Number | Company Name | Employee Markme | Description | Leave | |
---|---|---|---|---|---|
9788189999599 | TALES OF SHIVA | Mark | mark | 0 | |
9780099578079 | 1Q84 THE COMPLETE TRILOGY | HARUKI MURAKAMI | Mark | 0 | |
9780198082897 | MY KUMAN | Mark | Mark | 0 | |
9780007880331 | THE GOD OF SMAAL THINGS | ARUNDHATI ROY | 4TH HARPER COLLINS | 2 | |
9780545060455 | THE BLACK CIRCLE | Mark | 4TH HARPER COLLINS | 0 | |
9788126525072 | THE THREE LAWS OF PERFORMANCE | Mark | 4TH HARPER COLLINS | 0 | |
9789381626610 | CHAMarkKYA MANTRA | Mark | 4TH HARPER COLLINS | 0 | |
9788184513523 | 59.FLAGS | Mark | 4TH HARPER COLLINS | 0 | |
9780743234801 | THE POWER OF POSITIVE THINKING FROM | Mark | A & A PUBLISHER | 0 |
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 evalReg = /(\.)|(\[(\d)\])/; | |
const safeEval = (key: string, obj: any) => { | |
let lastKey; | |
let match; | |
do { | |
if (lastKey) { | |
if (match && match[2]) { | |
obj = obj[lastKey][match[3]]; | |
} else { | |
obj = obj[lastKey]; |
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
{ | |
"id": 1, | |
"version": "1.0.1", | |
"contributors": [ | |
"deepak", | |
"gary" | |
], | |
"actor": { | |
"name": "Tom Cruise", | |
"age": 56, |
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
class Enum { | |
constructor(args, startIndex = 0, defaultValue) { | |
const em = args.split("|").reduce((m, key, index) => { | |
m[(m[key] = index + startIndex)] = key; | |
return m; | |
}, {}); | |
em.value = em.key = (k) => em[k]; | |
return new Proxy(em, { | |
get: (obj, prop) => (prop in obj ? obj[prop] : defaultValue), | |
set: (obj, prop, value) => { |
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
/* | |
// How to use | |
curl -s https://gist.githubusercontent.com/deepakshrma/c77d297d5ff3e07ce172da2893bb49d0/raw/835f004cf234cf3a79fab1bd1b37df7db861773b/nodejs_init.js -O nodejs_init.js || node nodejs_init.js | |
*/ | |
const path = require("path"); | |
const fs = require("fs"); | |
const cwd = process.cwd(); | |
const fromRoot = (...args) => path.join(cwd, ...args); |
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
<!doctype html> | |
<html class="no-js" lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
<link rel="stylesheet" href="app.css"> | |
<style> | |
td { | |
border: 1px solid; |
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
class TicTac { | |
constructor() { | |
this.mat = [ | |
[-1, -1, -1], | |
[-1, -1, -1], | |
[-1, -1, -1], | |
]; | |
} | |
move(i, j, m) { | |
m ? this.moveX([i, j]) : moveO([i, j]); |
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 snippets = [ | |
{ | |
scope: "javascript,typescript", | |
prefix: "st_key_map", | |
body: `const mapKeys = (obj, fn) => { | |
let mapper = fn; | |
if (typeof fn === "string") mapper = x => x[fn]; | |
return Object.keys(obj).reduce((acc, k) => { | |
acc[mapper(obj[k], k, obj)] = obj[k]; | |
return acc; |