Skip to content

Instantly share code, notes, and snippets.

View rikkrome's full-sized avatar

Ricky Romero rikkrome

  • EA
  • Los Angeles, CA
View GitHub Profile
@rikkrome
rikkrome / index.html
Last active July 17, 2018 02:19
romeroricky.io - home - 07-16-18
<body>
<!--Font-awsome-->
<!-- <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet"> -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
<div class="grid">
<div class="header">
<div class="header-top">
<div class="header-top-nav">
<div class="container">
<div class="row">
npm install multer --save
@rikkrome
rikkrome / server.js
Created July 6, 2018 07:36
simple express.js
// server.js file
const express = require('express');
const mongoose = require('mongoose');
const app = express();
//
// ─── ROUTES ─────────────────────────────────────────────────────────────────────
//
app.get('/', (req, res) => {
res.send("Hello World");
@rikkrome
rikkrome / key.js
Last active July 6, 2018 08:03
mLab key
// replace <dbuser>: with your admin's username
// replace <dbpassword> with your admin's password
module.exports = {
mongoURI: 'mongodb://<dbuser>:<dbpassword>@ds123456.mlab.com:1234556/project-name'
}
@rikkrome
rikkrome / server.js
Created July 6, 2018 08:10
mongoose connect
// DB Config
const db = require('./config/keys').mongoURI;
// connect to mongoDB
mongoose
.connect(db)
.then(() => {
console.log('MongoDB Connected');
})
.catch(err => {
@rikkrome
rikkrome / server.js
Created July 6, 2018 08:21
express and mongoDB starting point
// server.js file
const express = require('express');
const mongoose = require('mongoose');
const app = express();
//
// ─── DATABASE ───────────────────────────────────────────────────────────────────
//
// DB Config
@rikkrome
rikkrome / linkedlist.js
Created August 7, 2018 19:33
JS Linked list
{
function LinkedList() {
this.head = null;
this.tail = null;
}
function Node(value, next, prev) {
this.value = value;
this.next = next;
this.prev = prev;
@rikkrome
rikkrome / The Technical Interview Cheat Sheet.md
Created August 17, 2018 16:47 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
# -------------------------------
# ENVIRONMENT CONFIGURATION
# -------------------------------
# Change Prompt
# ------------------------------------------------------------
# PS1 settings
# ---------------------------------------------------
# colors
export COLOR_NC='\e[0m' # No Color

React Native Performance Tips

  • Lazy loading screens
    • bottom tabs & top tabs
  • Tracking renders
    • counting the amount of times a component renders.
    • added a custom useRef() hook into all components / child components.
import { useRef } from 'react';