Skip to content

Instantly share code, notes, and snippets.

View ritz078's full-sized avatar

Ritesh Kumar ritz078

View GitHub Profile
View gist:8fcdc2f985789bd44cfb167a280dbafb

parseXFDF

This API is only available in standalone mode. The API looks like this:

type IParsedXFDF = {
  annotations: List<Annotation>
  formFieldValues?: Record<string, unknown>
  errors?: {
 errorMessage: string
@ritz078
ritz078 / license_key
Created October 7, 2020 07:38
PSPDFKit Demo License
View license_key
ptRxdH1sOvyp_KyHOZl6jXmDIQBEnHxcaf976eDpIOSvCpkIn1oWfoywGsTucj106xJiZO0E2RUn1SplvmA4uv0KxqLgI497XsForFwd4H4xmm_ZkNmzCYjWYQi7AcuLUKPXig5pZgy17md7-qsMG-ZrZ2Fc5cL1hlNTRSULihMnk_Biy094XZu32eoejtVEab3RJzBrr7MMok8EGOAiAMZzPB8SoHPs1zZ_W60wZJQjKtP2E_73RlwWXGoRR0Sy92REWsxsjo3wCSfNdciY533UuZNqy7nlQ3LtaX65ctV-kY5PMH_iXRGK8NymgI1dkgXVjZZe50tpDLIy1dGDTo4VK3010Z_G9af590NqyuLEd3IZUcAbPIfLznfelcLcwtkuF_Hz1cQAfnIrzU6ci2WGfkoV7g6PfwtZZQvMDyeRtROtKHrWpY6sc779q_egRVec5LiAJuZASDi4o4fDuHBgLozAbYfcR6fZ8Rvt7yg1fMYyM61f-0jiTWfAeAh6JBVBqgBwbq1DztcMsVwfGtYXRAeKr2hSD5DQgmsWNcBd4TQXn1myKBbmL6AR4r1ZREPpDFsdgFGsO8nrgLqziEbPCqL2woeip4jJKa1p9RetngZMzetbiKx-GHM_McPariswXUpWiE9zfW0NwWjgyBP62mR4KrfJVwh8CZoGcPbnEfz-K6La6KupWb23n2fxka15EESWzIPdvESi2aznr3AqnMRmi9WjX9HuDTcMLUpHKIMwQAXc-AAHPFoDAi0Z-uwARcXC3zepgwx_CBLzVptxkBcZb0CDLFrRCQ6EqlBxQA8rRrEMhF8vmJS9a4sAADPEbJtVJd4hc_AMbWGMllYRl3VNK1YMNuCiF1p7mDC7nLRaNyumaHUoFalsDNwaBUR-RK12g9IySfI7ZAxQdFqYiax3aXuQxkvHFVlpI1UBgsQCl2J8nVCfNjKiB4J2
@ritz078
ritz078 / flow-to-typescript.js
Last active August 1, 2019 14:26
flow-to-typescript
View flow-to-typescript.js
This file has been truncated, but you can view the full file.
/******/ (function(modules) { // webpackBootstrap
/******/ function hotDisposeChunk(chunkId) {
/******/ delete installedChunks[chunkId];
/******/ }
/******/ var parentHotUpdateCallback = window["webpackHotUpdate"];
/******/ window["webpackHotUpdate"] = // eslint-disable-next-line no-unused-vars
/******/ function webpackHotUpdateCallback(chunkId, moreModules) {
/******/ hotAddUpdateChunk(chunkId, moreModules);
/******/ if (parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules);
/******/ } ;
View package.json
{
"name": "snack-sdk-transform",
"main": "./snack-sdk.js",
"version": "2.2.1"
}
View json-to-go.js
/*
JSON-to-Go
by Matt Holt
https://github.com/mholt/json-to-go
A simple utility to translate JSON into a Go type definition.
*/
function jsonToGo(json, typename) {
let data;
let scope;
@ritz078
ritz078 / rust-reserved.js
Created September 6, 2017 20:29
A list of reserved keywords in Rust Language.
View rust-reserved.js
module.exports = [
"as",
"use",
"extern crate",
"break",
"const",
"continue",
"crate",
"else",
"if",
View gist:7a72b8c65c57264daeb169cc1cb096e9
This file has been truncated, but you can view the full file.
[{"pid":2159,"tid":1547,"ts":146345419103,"ph":"X","cat":"toplevel","name":"MessageLoop::RunTask","args":{"src_file":"../../components/scheduler/base/task_queue_impl.cc","src_func":"PushOntoImmediateIncomingQueueLocked"},"dur":4589,"tdur":1369,"tts":16506052},
{"pid":2159,"tid":1547,"ts":146345423552,"ph":"X","cat":"toplevel","name":"TaskQueueManager::ProcessTaskFromWorkQueue","args":{"src_file":"../../base/trace_event/trace_log.cc","src_func":"SetEnabled"},"dur":70,"tdur":64,"tts":16507286},
{"pid":2159,"tid":1547,"ts":146345423626,"ph":"X","cat":"toplevel","name":"TaskQueueManager::ProcessTaskFromWorkQueue","args":{"src_file":"../../base/trace_event/trace_log.cc","src_func":"SetEnabled"},"dur":11,"tdur":9,"tts":16507358},
{"pid":2159,"tid":1547,"ts":146345423640,"ph":"X","cat":"toplevel","name":"TaskQueueManager::ProcessTaskFromWorkQueue","args":{"src_file":"../../base/trace_event/trace_log.cc","src_func":"SetEnabled"},"dur":21,"tdur":18,"tts":16507372},
{"pid":2159,"tid":1547,"ts":146345423664,"ph":"X","ca
View preferES2015.js
// Do
export default MyComponent extends React.Component{}
MyComponent.propTypes = {
name: React.PropType.string
}
// Don't
export default MyComponent extends React.Component{
static propTypes = {
name: React.PropType.string
View embed.js
var x = new EmbedJS({
element: document.getElementById('rawText')
});
x.render();
@ritz078
ritz078 / what-forces-layout.md
Last active September 19, 2015 06:16 — forked from paulirish/what-forces-layout.md
What forces layout/reflow in Chrome. The comprehensive list.
View what-forces-layout.md

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()