Skip to content

Instantly share code, notes, and snippets.

@florindumitru
florindumitru / Common-Currency.json
Created May 18, 2020 06:26 — forked from ksafranski/Common-Currency.json
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@florindumitru
florindumitru / registerParseInstallation.js
Created September 25, 2018 06:51
Registering a Parse Installation with React Native
// Not published on npm! use this fork https://github.com/gpbl/react-native-device-info
import DeviceInfo from "@gpbl/react-native-device-info";
const PARSE_URL = "https://api.parse.com/1/installations";
const PARSE_APP_ID = "YOUR_APP_ID";
const PARSE_REST_KEY = "YOUR_REST_KEY";
function registerParseInstallation(pushToken) {
@florindumitru
florindumitru / gist:7764b0d1ef740b42b9cb01193ef4c62d
Created March 14, 2018 06:34 — forked from Ayms/gist:6451926
WebCrypto code example - Upload a file, encrypt it, calculate the hash and store the results using indexedDB

Code example using WebCrypto, File API, indexedDB, createObjectURL and Workers.

<input type="file" onsubmit="process_upload">
var workerjs=' \
  onmessage=function(evt) { \
		var encrypt=crypto.workersubtle.encrypt({name:"AES-CBC",iv:new Uint8Array(16)},evt.data[0]); \
		var buffer=evt.data[1]; \