Skip to content

Instantly share code, notes, and snippets.

View marshallbu's full-sized avatar

Marshall Upshur marshallbu

View GitHub Profile
@marshallbu
marshallbu / The Technical Interview Cheat Sheet.md
Created July 10, 2017 17:52 — 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.
<html>
<head>
<meta charset="UTF-8">
<?php
$debug=False;
set_time_limit(0);
$actionURL="/d3stryr-3stripes.php";
?>
<title>d3stryr 3stripes</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
@marshallbu
marshallbu / auto-arlo.groovy
Last active March 27, 2016 02:13 — forked from joebeeson/auto-arlo.groovy
Auto Arlo Control
/**
* Auto Arlo Control
*
* Created by Marshall Upshur <[email protected]>
* Original credit goes to Joe Beeson <[email protected]>
*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
$.ajax({
dataType: "json",
url: 'https://www.googleapis.com/customsearch/v1?cx=011793557827462124909%3Arceair__ljw&imgSize=large' +
'&safe=medium&searchType=image&key={API_KEY}&q=' + query,
success: function ( json ) {
var rand = Math.floor(Math.random() * json.items.length),
results = json.items;
$('img').attr('src', results[rand].link);
}
@marshallbu
marshallbu / exports.php
Last active August 29, 2015 14:05
specific export of pages manually in wordpress
// grab a snapshot of post IDs, just in case it changes during the export
// $post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts $where ORDER BY post_date_gmt ASC" );
# Export only a particular page and all its children
$post_ids = array();
$new_pages = array();
// $new_pages[] = 2; # Parent page ID, which we will export, along with all its children
$new_pages = array(1179,48,87);
while (count($new_pages)) {
$where = "WHERE post_parent IN (".join(',', $new_pages).")";
@marshallbu
marshallbu / FB question
Created November 4, 2013 22:29
question I was asked at FB where I received no feedback, now I see why
function multiply (n1, n2) {
//var numOfDigits = Math.log10(n1) + Math.log10(n2) + 1;
var result = [0];
var position = result.length - 1;
//make sure we have strings
n1 = n1.toString();
n2 = n2.toString();
for(var m = n1.length-1; m >= 0; m--) {