As easy as 1, 2, 3!
Updated:
- Aug, 08, 2022 update
configdocs for npm 8+ - Jul 27, 2021 add private scopes
- Jul 22, 2021 add dist tags
- Jun 20, 2021 update for
--access=public - Sep 07, 2020 update docs for
npm version
| var BASE64_MARKER = ';base64,'; | |
| function convertDataURIToBinary(dataURI) { | |
| var base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length; | |
| var base64 = dataURI.substring(base64Index); | |
| var raw = window.atob(base64); | |
| var rawLength = raw.length; | |
| var array = new Uint8Array(new ArrayBuffer(rawLength)); | |
| for(i = 0; i < rawLength; i++) { |
(MSIE|(?!Gecko.+)Firefox|(?!AppleWebKit.+Chrome.+)Safari|(?!AppleWebKit.+)Chrome|AppleWebKit(?!.+Chrome|.+Safari)|Gecko(?!.+Firefox))(?: |\/)([\d\.apre]+)
This regular expression is capable of retrieving the browser and version for the following browsers;
| var os = require("os"); | |
| //Create function to get CPU information | |
| function cpuAverage() { | |
| //Initialise sum of idle and time of cores and fetch CPU info | |
| var totalIdle = 0, totalTick = 0; | |
| var cpus = os.cpus(); | |
| //Loop through CPU cores |
| // 32 bit FNV-1a hash | |
| // Ref.: http://isthe.com/chongo/tech/comp/fnv/ | |
| function fnv32a( str ) | |
| { | |
| var FNV1_32A_INIT = 0x811c9dc5; | |
| var hval = FNV1_32A_INIT; | |
| for ( var i = 0; i < str.length; ++i ) | |
| { | |
| hval ^= str.charCodeAt(i); | |
| hval += (hval << 1) + (hval << 4) + (hval << 7) + (hval << 8) + (hval << 24); |
| { | |
| ".123" : "application/vnd.lotus-1-2-3", | |
| ".3dml" : "text/vnd.in3d.3dml", | |
| ".3g2" : "video/3gpp2", | |
| ".3gp" : "video/3gpp", | |
| ".a" : "application/octet-stream", | |
| ".aab" : "application/x-authorware-bin", | |
| ".aac" : "audio/x-aac", | |
| ".aam" : "application/x-authorware-map", | |
| ".aas" : "application/x-authorware-seg", |
| { | |
| "title": "Apache Overview", | |
| "services": { | |
| "query": { | |
| "list": { | |
| "2": { | |
| "id": 2, | |
| "type": "topN", | |
| "query": "", | |
| "alias": "", |
| // NOTICE 2020-04-18 | |
| // Please see the comments below about why this is not a great PRNG. | |
| // Read summary by @bryc here: | |
| // https://github.com/bryc/code/blob/master/jshash/PRNGs.md | |
| // Have a look at js-arbit which uses Alea: | |
| // https://github.com/blixt/js-arbit | |
| /** |
| # coding:utf-8 | |
| from kivy.app import App | |
| from kivy.uix.image import Image | |
| from kivy.clock import Clock | |
| from kivy.graphics.texture import Texture | |
| import cv2 | |
| class KivyCamera(Image): | |
| def __init__(self, capture, fps, **kwargs): |
| import express from "express"; | |
| /** | |
| * Takes a route handling function and returns a function | |
| * that wraps it after first checking that the strings in | |
| * `reserved` are not part of `req.body`. Used for ensuring | |
| * create and update requests do not overwrite server-generated | |
| * values. | |
| */ | |
| function checkReservedParams(routeHandler, ...reserved) { |