Skip to content

Instantly share code, notes, and snippets.

View karatechops's full-sized avatar
🐙

Alex Mejias karatechops

🐙
View GitHub Profile
This file has been truncated, but you can view the full file.
{"info": {"description": "<div>\n Looking for product information? <a href=\"http://www.hpe.com\" target=\"_blank\">Visit hpe.com</a>\n</div>\n\n<div>\n Working on a project and need a copy of the OpenAPI schema? <a href=\"/api/v1/openapi\" target=\"_blank\">View/download it here</a>\n</div>\n\n<div>\n Having trouble with the API explorer?\n <ul>\n <li>For live assistance, go to the <a href=\"http://www.hpe.com/assistance\">Contact Hewlett Packard Enterprise Worldwide</a> website</li>\n <li>To access documentation and support services, go to the <a href=\"http://www.hpe.com/support/hpesc\">Hewlett Packard Enterprise Support Center</a> website</li>\n </ul>\n</div>\n\n<h4 class=\"opblock-tag\" id=\"_doc_api_authentication\">API Authentication</h4>\n\n<div id=\"api_login_auto\">\n This session is using the API token from the Composable Fabric Manager UI.\n Proceed with any API call!\n</div>\n\n<div id=\"api_login_manual\">\n To begin using this API explorer, you'll first nee
This file has been truncated, but you can view the full file.
servers:
- url: '/redfish/v1'
components:
schemas:
AccountService:
description: This is the schema definition for the Account service. It represents
the properties for this service and has links to the list of accounts.
properties:
'@odata.context':
example: /$metadata#AccountService.AccountService
@karatechops
karatechops / open-vscode.sh
Created November 5, 2019 21:46
a script to open vscode from terminal
function code {
if [[ $# = 0 ]]
then
open -a "Visual Studio Code"
else
local argPath="$1"
[[ $1 = /* ]] && argPath="$1" || argPath="$PWD/${1#./}"
open -a "Visual Studio Code" "$argPath"
fi
}
import ldap from 'ldapjs';
import { debug } from './index';
let client;
let timer;
export const getLdapUser = uid =>
new Promise((resolve, reject) => {
client = ldap.createClient({
url: 'ldap://ldap.hp.com',
{
"window.zoomLevel": 2.6,
"files.encoding": "utf8",
"files.autoGuessEncoding": false,
"explorer.autoReveal": false,
"editor.minimap.enabled": false,
"workbench.colorTheme": "HPE DEV",
"editor.fontSize": 16,
"editor.letterSpacing": 0.25,
"editor.fontWeight": "100",
export function fileUpload(file) {
let formData = new FormData();
for(name in file) {
formData.append(name, file[name]);
}
return fetch('https://my-website.com/api/file/upload', {
method: 'POST',
// if your app is storing auth tokens in a cookie include credentials
@karatechops
karatechops / trackButton.js
Created September 26, 2019 20:58
Example of using Track component
import React from 'react';
import PropTypes from 'prop-types';
import { Track } from 'containers';
import { Link } from 'react-router';
export const Anchor = ({ active, url, children, track, category: customCategory, // eslint-disable-line
label: customLabel, action: customAction, ...rest }) => {
let linkNode = <div />;
let category = 'Navigation';
let label = '';
@karatechops
karatechops / track.js
Created September 26, 2019 20:56
React-ga Track component
import React from 'react';
import PropTypes from 'prop-types';
import ReactGA from 'react-ga';
class Track extends React.Component {
constructor(props) {
super(props);
this.trackEvent = this.trackEvent.bind(this);
}
trackEvent() {
{
"openapi": "3.0.1",
"servers": [{
"url": "/containers/v1"
}],
"info": {
"title": "HPE Nimble Storage Container Storage Provider (CSP) REST API",
"description": "This API, used by the HPE CSI Driver for Kubernetes, enables management of resources used for\ncontainer workloads. It is not intended for direct usage outside of the CSI driver\nbut is provided here for documentation purposes.",
"contact": {
"name": "Hewlett Packard Enterprise"
{
"openapi": "3.0.1",
"basePath": "/containers/v1",
"info": {
"title": "HPE Nimble Storage Container Storage Provider (CSP) REST API",
"description": "This API, used by the HPE CSI Driver for Kubernetes, enables management of resources used for\ncontainer workloads. It is not intended for direct usage outside of the CSI driver\nbut is provided here for documentation purposes.",
"contact": {
"name": "Hewlett Packard Enterprise"
},
"version": "1.0.0"