Skip to content

Instantly share code, notes, and snippets.

View daveyholler's full-sized avatar
🐊
Later gator

Davey Holler daveyholler

🐊
Later gator
View GitHub Profile
[
{
"id": 1,
"first_name": "Jack",
"last_name": "Shephard",
"alias": "Doc",
"occupation": "Spinal Surgeon",
"city": "Los Angeles",
"country": "United States",
"date_of_birth": "1969-12-03T00:00:00.000Z",
@daveyholler
daveyholler / application_controller.rb
Last active December 2, 2021 17:04
Rails token authentication
# frozen_string_literal: true
class ApplicationController < ActionController::API
before_action :authorized
def encode_token(payload)
JWT.encode(payload, 'mySuperSecretKey')
end
def auth_header
export interface Episode {
id: string;
seasonNumber: string;
episodeNumber: string;
title: string;
image: string;
year: string;
released: string;
plot: string;
imDbRating: string;
call plug#begin('~/.vim/plugged')
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/nvim-cmp'
Plug 'neovim/nvim-lspconfig'
Plug 'mattn/emmet-vim'
Plug 'qpkorr/vim-bufkill'
export interface Episode {
id: string;
seasonNumber: string;
episodeNumber: string;
title: string;
image: string;
year: string;
released: string;
plot: string;
imDbRating: string;
import { useState } from 'react';
import {
EuiButton,
EuiPageTemplate,
} from '@elastic/eui';
export default function Home() {
const [activeTab, setActiveTab] = useState('tabOne');
// Imported global styling from EUI
@import url("https://fonts.googleapis.com/css?family=Roboto+Mono:400,400i,700,700i");
@import url("https://rsms.me/inter/inter-ui.css");
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Roboto+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap");
@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_colors_light.scss';
@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_globals.scss';
body {
@include euiHeaderAffordForFixed($euiHeaderHeightCompensation * 2);
React, { useState } from 'react';
import {
EuiAccordion,
EuiButton,
euiDragDropReorder,
EuiDragDropContext,
EuiDraggable,
EuiDroppable,
EuiFlexGroup,
EuiFlexItem,
@daveyholler
daveyholler / getting_ready_for_prototyping.md
Created November 9, 2021 17:19
This small guide will help you get your Mac ready for prototyping in React. This guide was adapted from @elastic's design manual.

Getting ready for prototyping

Before we get started, you'll want to do the following to get your Mac ready. This mostly involves using your terminal.

  1. Install Brew, a package manager for OSX. We’ll be using this to install the essentials.
  2. The above should also install the OSX command line tools that come with Xcode, but in some cases you might want to do this on your own.
  3. Using brew you'll want to brew install nvm yarn
    • NVM is a virtual environment for Node. The reason we install it is that previous releases of the software might run on an older version of Node and this allows us to switch quickly.
    • Yarn is a Node package manager we use instead of npm.
  4. Once nvm is installed we need to do a few things:

Your First Component

In this section, we'll be making some changes to App.tsx to remove the auto-generated cruft and we'll start wiring up our very own Greeting component.

Step 1: Launch your app

Lets open the terminal and fire up our application.

cd ~/prototypes/lesson-01
yarn start