Skip to content

Instantly share code, notes, and snippets.

View amaxwell01's full-sized avatar

Andrew Maxwell amaxwell01

View GitHub Profile
@amaxwell01
amaxwell01 / interviewitems.MD
Created September 15, 2012 14:17
My answers to over 100 Google interview questions

##Google Interview Questions: Product Marketing Manager

  • Why do you want to join Google? -- Because I want to create tools for others to learn, for free. I didn't have a lot of money when growing up so I didn't get access to the same books, computers and resources that others had which caused money, I want to help ensure that others can learn on the same playing field regardless of their families wealth status or location.
  • What do you know about Google’s product and technology? -- A lot actually, I am a beta tester for numerous products, I use most of the Google tools such as: Search, Gmaill, Drive, Reader, Calendar, G+, YouTube, Web Master Tools, Keyword tools, Analytics etc.
  • If you are Product Manager for Google’s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Google’s competitors, and how does Google compete with them? -- Google competes on numerous fields: --- Search: Baidu, Bing, Duck Duck Go
@amaxwell01
amaxwell01 / missing_int_from_array.js
Last active June 15, 2021 15:32
How to find the missing numbers from an array of integers. Q: You’re given an array of N integers. N may be very large. You know that every integer 1-N appears once in the array, except there is one or more integer(s) missing.
/* ============================
* EXAMPLE 1:
* ============================ */
var numbers = [0,1,3,4,5,7,8]; // Missing 2,6
var lastNumber = numbers[numbers.length - 1];
var expectedSum = (lastNumber * (lastNumber + 1)) / 2;
var actualSum = 0;
// Show the difference
for (var i = 0; i < numbers.length; i++) {
@amaxwell01
amaxwell01 / wordpressfixedloop.php
Created September 27, 2012 06:56
A while loop with dedicated customized chunks in Wordpress
<?php
// Select only the parent pages for the industry pages which will be used to display the industry
// pages on the home page and on the industry's main page
$wp_query = new WP_Query( array(
'post_type' => 'industries',
'posts_per_page' => -1,
'post_parent' => '0'
) );
$query = new WP_Query( $args );
@amaxwell01
amaxwell01 / .vimrc
Created November 6, 2012 23:31
My .vimrc file
"=== Colors ==="
colorscheme andrewmaxwell-1
syntax on
set number " Show line numbers
set cursorline " Highlight the currently selected line
set undolevels=1000 " Set undo amount to 1000
set ignorecase " Enable case insenstive search
set ruler " show current position at bottom
@amaxwell01
amaxwell01 / custompostquery.php
Created July 29, 2012 21:31
Simple and clean wordpress custom post query
<ul>
<?php
$wp_query = new WP_Query( array(
'post_type' => 'gallery',
'posts_per_page' => -1
));
if( have_posts() ) {
while ( $wp_query->have_posts() ) {
$wp_query->the_post();
const BLOCK_TAGS = {
p: 'paragraph',
li: 'list-item',
ul: 'bulleted-list',
ol: 'numbered-list',
blockquote: 'quote',
pre: 'code',
h1: 'heading-one',
h2: 'heading-two',
h3: 'heading-three',
// create the single note view where the user can edit it
import React, { Component } from 'react';
import render from 'react-dom';
import { Link } from 'react-router';
import { connect } from 'react-redux';
import { Editor } from 'slate-react'
import SlateHtml from 'slate-html-serializer';
import { State } from 'slate';
import * as parse5 from 'parse5';
import NotesContainer from '../../containers/NotesContainer';
@amaxwell01
amaxwell01 / index.html
Created May 21, 2016 18:37
requestAnimationFrame
<div id="SomeElementYouWantToAnimate"></div>
@amaxwell01
amaxwell01 / googlePlayTVShows.js
Created May 7, 2016 05:06
Get an array of objects with tv show name and episodes, in my Google Play movies colletion
/*
* Return a Array of objects with tv show name and episodes, in my Google Play movies colletion
* https://play.google.com/movies
* Must be signed in and viewing the page for this to work
* Created by: Andrew Maxwell
* Created on: May 6th, 2016
*/
var tvShowsList = Array.prototype.slice.call(document.querySelectorAll('#body-content > div > div > div.main-content > div > div:nth-child(2) > div.tvshow-library > div'));
var getEpisodes = function(episodes) {
episodeNames = episodes.map(function(episode) {
@amaxwell01
amaxwell01 / googlePlayMovies.js
Created May 7, 2016 05:04
Get a list of movie names from my Google Play Movies collection
/*
* Return a Array of movie names in my Google Play movies colletion
* https://play.google.com/movies
* Must be signed in and viewing the page for this to work
* Created by: Andrew Maxwell
* Created on: May 6th, 2016
*/
var movieList = Array.prototype.slice.call(document.querySelectorAll('#body-content > div > div > div.main-content > div > div:nth-child(2) > div.id-cluster-container.cluster-container > div > div.id-card-list.card-list.two-cards > div'));
var movies = movieList.map(function(movie) {
var movieName = movie.innerText;