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
#!/bin/bash | |
set -o pipefail | |
UZIPVER=$(date "+0.%Y%m%d.0") | |
# Remove and re-clone | |
rm -rf UZIP.js | |
git clone https://github.com/photopea/UZIP.js/ | |
cd UZIP.js | |
# Generate package.json |
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
/* this sample was run in nodejs */ | |
var XLSX = require('xlsx'); | |
/* build up a very simple workbook */ | |
var wb = { | |
SSF: XLSX.SSF.get_table(), | |
SheetNames: ["Sheet1"], | |
Sheets: { | |
Sheet1: { | |
'!ref': 'A1:A1', |
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
var XLS = { utils: { | |
// originally https://github.com/SheetJS/js-xls/blob/4076850087785b76e6814213877eea99a8390be5/xls.js#L5135 | |
sheet_to_row_object_array_with_column_index_props: | |
function(sheet, opts) { | |
var val, row, r, hdr = {}, isempty, R, C, v; | |
var out = []; | |
opts = opts || {}; | |
if(!sheet || !sheet["!ref"]) return out; | |
r = xls_utils.decode_range(sheet["!ref"]); | |
for(R=r.s.r, C = r.s.c; C <= r.e.c; ++C) { |
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
/* require XLSX */ | |
var XLSX = require('XLSX') | |
function datenum(v, date1904) { | |
if(date1904) v+=1462; | |
var epoch = Date.parse(v); | |
return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000); | |
} | |
function sheet_from_array_of_arrays(data, opts) { |
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(undefined) { | |
'use strict'; | |
// Check if dependecies are available. | |
if (typeof XLSX === 'undefined') { | |
console.log('xlsx.js is required. Get it from https://github.com/SheetJS/js-xlsx'); | |
return; | |
} | |
if (typeof _ === 'undefined') { | |
console.log('Lodash.js is required. Get it from http://lodash.com/'); |
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
var xlsx = require('xlsx'); | |
var _ = require('underscore'); | |
var file = 'test.xlsx'; | |
function parsePos(x) { // "AB" => 26*1 + 1*2 => 28 | |
var str = x.toUpperCase(); | |
var ret = 0; | |
for(var i=0,len=str.length; i<len; i++) { | |
ret += Math.pow(26,(len - i -1)) * (str.charCodeAt(i)-64); |
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
/** | |
* Converts an RGB color value to HSL. Conversion formula | |
* adapted from http://en.wikipedia.org/wiki/HSL_color_space. | |
* Assumes r, g, and b are contained in the set [0, 255] and | |
* returns h, s, and l in the set [0, 1]. | |
* | |
* @param Number r The red color value | |
* @param Number g The green color value | |
* @param Number b The blue color value | |
* @return Array The HSL representation |