Skip to content

Instantly share code, notes, and snippets.

View ElenaG518's full-sized avatar

ElenaG518 ElenaG518

View GitHub Profile
@ElenaG518
ElenaG518 / test1
Created August 24, 2021 23:38 — forked from joeeames/test1
import { DebugElement } from "@angular/core";
import { ComponentFixture, TestBed } from "@angular/core/testing"
import { By } from "@angular/platform-browser";
import { HeroComponent } from "./hero.component"
describe('HeroComponent (integration tests)', () => {
let fixture: ComponentFixture<HeroComponent>;
beforeEach(() => {
@ElenaG518
ElenaG518 / test.ts
Last active August 24, 2021 23:24 — forked from joeeames/test.ts
import { TestBed, ComponentFixture } from "@angular/core/testing"
import { NO_ERRORS_SCHEMA } from "@angular/core";
import { HeroesComponent } from "./heroes.component";
import { HeroService } from "../hero.service";
import { of } from "rxjs";
import { HeroComponent } from "../hero/hero.component";
import { By } from "@angular/platform-browser";
describe('Hero Component', () => {
@ElenaG518
ElenaG518 / codility_solutions.txt
Created March 28, 2019 00:24 — forked from lalkmim/codility_solutions.txt
Codility Solutions in JavaScript
Lesson 1 - Iterations
- BinaryGap - https://codility.com/demo/results/trainingU2FQPQ-7Y4/
Lesson 2 - Arrays
- OddOccurrencesInArray - https://codility.com/demo/results/trainingFN5RVT-XQ4/
- CyclicRotation - https://codility.com/demo/results/trainingSH2W5R-RP5/
Lesson 3 - Time Complexity
- FrogJmp - https://codility.com/demo/results/training6KKWUD-BXJ/
- PermMissingElem - https://codility.com/demo/results/training58W4YJ-VHA/
@ElenaG518
ElenaG518 / live portfolio site
Last active February 13, 2019 23:59
live portfolio site
https://elenag518.github.io/portfolio/
@ElenaG518
ElenaG518 / headline and bio text
Created February 12, 2019 22:10
headline and bio text
Hello! I’m Elena Granados. I’m a fullstack developer with a background in finance.
I’m currently living in west Los Angeles. I enjoy technology, music, nature, sustainability, and letting my mind imagine ways in which we can create a better world. I enjoy the potential that web development has in creating unique solutions to everyday problems in an easy, convenient, an approachable way.
There are many challenges to solve, and I want to be part of the solution, so let’s get started!
Write a function that takes an integer value and checks to see if it is even or odd using the bit-wise AND operator.
Hint: Think about what the value of the least-significant bit will be for even and odd numbers.
function evenOrOdd(int) {
if (int & 1) {
console.log(`${int} is an odd number`);
} else if (!(int & 1)) {
console.log(`${int} is an even number`);
}
}
What is 2^5 in binary?
100000 = 32 = [1]*2^(5)+ [0]*2^(4) + [0]*2^(3) + [0]*2^(2) + [0]*2^(1) + [0]*2^(0))
What is 2^5 - 1 in binary?
011111 = 31 = [0]*2^(5)+ [1]*2^(4) + [1]*2^(3) + [1]*2^(2) + [1]*2^(1) + [1]*2^(0))
What is the general rule for binary numbers which are of the form 2^n or 2^n - 1?
They are the One's complement fo each other, or the inverse binary digits of each other.
@ElenaG518
ElenaG518 / Big O notation
Created January 3, 2019 18:48
Big O notation
Even or odd -- constant O(1)
Are you here? -- polynomial O(n^2)
Doubler -- linear O(n)
Naive Search -- linear O(n)
Creating pairs -- polynomial O(n^2)
Computing fibonaccis -- linear O(n)
An Efficient Search -- logarithmic O(log n)
Random element-- constant O(1)
Is it prime? -- linear O(n)
@ElenaG518
ElenaG518 / gist:14a54b389c73d124d77176e7fa8d4c32
Created November 28, 2018 04:07
Trendlier user stories
As a user I should be able to login
As a user I should be able to register
as a user I should be able to stay logged in indefinitely until I log out
as a user I should be able to select a category of items
as a user I should be able to purchase items from the results of the category search
as a user I should be able to pick different items and save them to my wishlist
as a user I should be able to edit or delete items from my wishlist
@ElenaG518
ElenaG518 / Trash to treasure
Created November 7, 2018 23:44
Trash to treasure
Trash to treasure is an app that promotes the collection and disposal of residential food waste. Neighborhood volunteers collect food scraps from participating members, and drop it off at local compositng hubs. Trash to Treasure was created for the purpose of reducing food waste in landfills.