Skip to content

Instantly share code, notes, and snippets.

View mspclaims's full-sized avatar

Acclaim mspclaims

View GitHub Profile
@mspclaims
mspclaims / AutoComplete.js
Created August 26, 2018 15:47
Floating label issue
/* eslint-disable react/prop-types */
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Select from 'react-select';
import { withStyles } from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';
import NoSsr from '@material-ui/core/NoSsr';
import TextField from '@material-ui/core/TextField';
@mspclaims
mspclaims / swagger_model_def.js
Last active January 19, 2018 20:28
Generate Swagger model definition from JSON schema files (http://json-schema.org/draft-06/schema)
let getSwaggerDefinitions = function(){
let schemaPassword = require('../schemas/changePasswordRequest.json');
let schemaUser = require('../schemas/createUserRequest.json');
let schemaLogin = require('../schemas/loginUserRequest.json');
let schemaProfile = require('../schemas/profilePutSchema.json');
let schemas={password:schemaPassword, user:schemaUser, login: schemaLogin, profile: schemaProfile};
//let schemas={profile: schemaProfile};
let reply={};
for (var key in schemas) {
let upperLevel = schemas[key].properties;
@mspclaims
mspclaims / restoreUUID.js
Created January 19, 2018 00:24
reformat UUID which had dashes stripped out
module.exports.restoreUUID = function(id){
if (id.length != 32) return id;
let template = "8-4-4-4-12";//using string to provide guid template
let offset = 0;
return template
.split("-")
.map(length => {
let part = id.substr(offset,length);
offset += parseInt(length);
return part;
// provided by in @Spaider (https://github.com/Spaider)
// in https://github.com/serverless/serverless/issues/1439#issuecomment-273482220
'use strict'
class VerboseDeploy {
constructor(serverless, options) {
this.serverless = serverless
this.options = options