Skip to content

Instantly share code, notes, and snippets.

View celestelayne's full-sized avatar
🌴
coding

Celeste celestelayne

🌴
coding
View GitHub Profile
@celestelayne
celestelayne / Output Grouped by Color
Last active June 18, 2022 16:14
Process the input & print out in the console an output where people are grouped by the same color they have.
/*
We need you to process the above input & print out in the console an output where people are grouped by the same color they have.
Assumptions:
- Group1: is an object inside another object, groups
- John: is a property of the object, Group1
*/
const groups = {
@celestelayne
celestelayne / index.html
Created April 23, 2021 20:28
turntable_project_04
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@splidejs/splide@latest/dist/css/splide.min.css">
<link rel="nav" href="https://use.fontawesome.com/releases/v5.11.2/css/all.css">
<link rel="stylesheet" href="style-sheet.css">
// -------------
// Instructions:
// -------------
//
// 1 create two linked lists sorted by date
// 2. create a new linked list (combined list)
// 3. compare head of list-01 with head of list-02 (currentNode = this.head)
// 4. if list-01.head < list-02.head
// 5. add list-01.head to combined list (using add to tail method)
// 6. traversing list-01
@celestelayne
celestelayne / script.js
Created June 29, 2020 21:00
celeste-layne-brown-institute
class MyAnalytics {
constructor(){
}
pageLoad() {
fetch("https://httpbin.org/get?click=1&type=page-views")
.then(response => response.json())
.then(data => console.log("pageLoad request sent"));
}
@celestelayne
celestelayne / script.js
Created June 29, 2020 21:00
celeste-layne-brown-institute
class MyAnalytics {
constructor(){
}
pageLoad() {
fetch("https://httpbin.org/get?click=1&type=page-views")
.then(response => response.json())
.then(data => console.log("pageLoad request sent"));
}

Keybase proof

I hereby claim:

  • I am celestelayne on github.
  • I am celestelayne (https://keybase.io/celestelayne) on keybase.
  • I have a public key ASDAJt3UG8jg47M95LzQxca_DY2Sv5ydQFA-U6cyUFRxMgo

To claim this, I am signing this object:

Q: Write a function that takes a list of integers and returns the 4 highest in O(n) time.

A: Here, I use the merge sort algorithm since it uses O(n) space complexity and O(log(n)) runtime complexity. The following is my approach:

  1. First, divide the array into halves:
arr = [1, 5, 6, 11, 3, 4, 8, 13];

const mergeSort = (arr) => {
@celestelayne
celestelayne / pair_programming_roles
Last active July 31, 2019 02:05 — forked from jordanpoulton/pair_programming_roles
Pair Programming Role Definitions - Driver:Navigator
Driver:
-Write the code according to the navigator's specification
-Listen intently to the navigators instructions
-Ask questions wherever there is a lack of clarity
-Offer alternative solutions if you disagree with the navigator
-Where there is disagreement, defer to the navigator. If their idea fails, get to failure quickly and move on
-Make sure code is clean
-Own the computer / keyboard
-Ignore larger issues and focus on the task at hand
-Trust the navigator - ultimately the navigator has the final say in what is written
@celestelayne
celestelayne / authentication_with_bcrypt_in_rails_4.md
Created February 23, 2019 12:34 — forked from eerwitt/authentication_with_bcrypt_in_rails_4.md
Simple Authentication in Rail 4 Using Bcrypt

#Simple Authentication with Bcrypt

This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.

The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).

You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault

##Steps