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
Show hidden characters
{ | |
"presets": [ | |
"es2015", | |
"stage-3" | |
], | |
"env": { | |
"test": { | |
"plugins": [ | |
[ | |
"istanbul", |
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
/** | |
* Scroll to id, with defined offset. | |
* Since we cannot control offset when scroll by anchor | |
*/ | |
function scrollToId(id, offset = 0) { | |
let target = document.querySelector(`#${id}`); | |
if (!target) { | |
return; | |
} | |
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 removeListener(target) { | |
for (let key in target) { | |
if (key.match(/^on/)) { | |
target[key] = null; | |
} | |
} | |
} | |
removeListener(document) | |
removeListener(document.body) |
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
/* @source: https://stackoverflow.com/a/10730777 */ | |
function textNodesUnder(el){ | |
var n, a=[], walk=document.createTreeWalker(el,NodeFilter.SHOW_TEXT,null,false); | |
while(n=walk.nextNode()) a.push(n); | |
return a; | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script src="https://unpkg.com/@reactivex/rxjs@5.0.3/dist/global/Rx.js"></script> |
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
/** | |
* convert bson object id to uuid | |
* translate from original python version by @enaeseth | |
* @see https://gist.github.com/enaeseth/5768348 | |
*/ | |
import ObjectId from 'bson-objectid' | |
const UUID_EPOCH = new Date(1582, 9, 15) // 15 Oct 1582 | |
const UUID_VARIANT_1 = 0b1000000000000000 // wtf? |
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
{ | |
"version": "0.2.0", | |
"configurations": [{ | |
"type": "chrome", | |
"request": "launch", | |
"name": "Launch Chrome with ng serve", | |
"url": "http://localhost:4200", | |
"webRoot": "${workspaceRoot}", | |
"runtimeExecutable": "/usr/bin/chromium-browser", | |
"skipFiles": [ |
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 | |
* node render.js | |
* | |
* curl -O -d '{ "url": "https://google.com" }' http://localhost:9567/any_name.pdf | |
* | |
* NOTE: ubuntu 14.04 require some additional package | |
* | |
* apt-get install -yq --no-install-recommends \ | |
* libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \ |
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
#! /usr/bin/node | |
const fs = require('fs') | |
const { resolve } = require('path') | |
const fileHeader = [ | |
'msgid ""', | |
'msgstr ""', | |
'"MIME-Version: 1.0\\n"', | |
'"Content-Type: text/plain; charset=utf-8\\n"', |
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
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel.DataAnnotations; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Microsoft.EntityFrameworkCore; | |
namespace CsTest.ChangeTracking | |
{ |
OlderNewer