Skip to content

Instantly share code, notes, and snippets.

View NickyYo's full-sized avatar

Nicholas Mitchell NickyYo

  • Manchester, England, UK
View GitHub Profile
@NickyYo
NickyYo / gist:2c69d01519dc046c94bcea1b6338dc4a
Last active May 4, 2018 10:55
Data update app user guide

Data upload user guide

Upload your data directly into SPINR and use it to build new tabular datasets and services.

Accepted file types and transfer limits

File type Transfer limit
CSV 100MB
JSON 100MB
## Data upload user guide
Upload your data directly into SPINR and use it to build new tabular datasets and services.
## Accepted file types and transfer limits
| File type | Transfer limit |
| ------------- | -------------- |
| CSV | unlimited |
| JSON | unlimited |
@NickyYo
NickyYo / bytesToSize.js
Created April 30, 2018 10:46
Converts bytes to KB, MB, GB, TB
bytesToSize(bytes: any) {
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
if (bytes == 0) return '0 Byte';
var i = Math.floor(Math.log(bytes) / Math.log(1024));
return Math.round(bytes / Math.pow(1024, i)) + ' ' + sizes[i];
};
@NickyYo
NickyYo / cloudinary_express_upload.js
Last active December 2, 2017 14:51
Cloudinary upload with 'express' & 'express-fileupload'
import cloudinary from 'cloudinary';
cloudinary.config({
api_key: '',
api_secret: '',
cloud_name: ''
});
export function sendMail(req, res) {
cloudinary.v2.uploader.upload_stream({ tags: "snap_qoute_me" }, function(error, result) {
axios.interceptors.response.use(
function(response) {
return response
},
function (error) {
if (error.response && error.response.data && error.response.data.location) {
console.log('error.response', error.response);
}
return Promise.reject(error);
}
import './style.scss';
import * as React from 'react';
import { Popover } from '../';
import { Position } from '@blueprintjs/core';
interface INavAccountPopover { }
export const NavAccountPopover: React.StatelessComponent<INavAccountPopover> = (props) => {
return (<Popover position={Position.BOTTOM_LEFT} content={(<div>ALL YOUR HTML AND STYLING HERE</div>)}>
<Button>When this is clicked the element inside the content property is shown as a popover</Button>