Skip to content

Instantly share code, notes, and snippets.

View karatechops's full-sized avatar
🐙

Alex Mejias karatechops

🐙
View GitHub Profile
@karatechops
karatechops / mac-node-setup.md
Last active April 29, 2020 13:55
Node - Node Setup

Installing NVM/Node on latest version of OSX

Install Git/Homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
brew install git

Install NVM

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
If the install command produces an error asking for a .profile or .bashrc run touch ~./profile then run the install command again

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",
@karatechops
karatechops / hacking-for-dummies.md
Last active November 2, 2019 19:12
Mac Developer Setup

So you want to learn how to hack?

Then this is not the guide for you. But if you want to learn how to setup your new fancy mac for development you've found the right place.

Terminal for hackers

Just kidding, still for developers. The following steps are taken directly from Wes Bos' Smashing Magazine article.

  • Download and install iTerm2
  • Download and install Xcode, you'll need Xcode's developer tools to accomplish the next step. Be sure to grab the latest release version not beta, we all know mac beta really means pre-pre-alpha.
  • Install ZSH / Oh My ZSH. sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)".
  • Enable hidden folders - in your terminal window run defaults write com.apple.finder AppleShowAllFiles YES then restart your finder by holding option and right clicking the finder icon, cli
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() {