Skip to content

Instantly share code, notes, and snippets.

View internetsadboy's full-sized avatar
💭
🎣

internetsadboy

💭
🎣
  • DEGOBAH SYSTEM
View GitHub Profile

Howdy, job seeker!

Below are 3 code exercises that will allow us to get a sense for your coding chops and give you exposure to the type of work you'd be doing on a regular basis to ensure you enjoy it. This is isn’t your standard front-end dev gig, as you’ll be writing code that is inserted into websites via 3rd party testing tools like Optimizely and Dynamic Yield. The below exercises are designed to reflect that.

Instructions

  1. Create a new gist containing the raw text from the below exercises
  2. Name your gist "yourName-surefoot-application.md"
  3. Add your code (in your new file) where indicated
  4. When complete, revisit the job requirements at the bottom of the description to ensure you're sending a complete application and :shipit:
@internetsadboy
internetsadboy / index.js
Created July 26, 2020 01:31
"index.js" for express (upwork proposal question) - JARED LAMONT
const express = require('express');
const path = require('path');
// initialize app
const app = express();
const port = 3000;
// assuming ~/public/index.html
app.get('/html', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'index.html'));
@internetsadboy
internetsadboy / LinkingIOSExample.jsx
Created October 8, 2015 12:18
LinkingIOSExample: url resolves to a truncated fragment
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
LinkingIOS,
Text,
View,
} = React;
@internetsadboy
internetsadboy / index.html
Last active August 29, 2015 14:26
Multi-category Autocomplete w/ PHP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Algolia - Multi-category Autocomplete</title>
<style type="text/css">
.twitter-typeahead { width: 100%; }
.twitter-typeahead .tt-input, .twitter-typeahead .tt-hint { width: 100%; margin: 0px; padding: 8px 12px; border: 2px solid #ccc; outline: none; }
.twitter-typeahead .tt-input:focus { border: 2px solid #0097cf; }
@internetsadboy
internetsadboy / boggle-write-up.md
Last active August 29, 2015 14:20
boggle write up

Given that a Boggle board's dimensions are N x N, and dice selection is dependent on relative die adjacencies, it seemed practical to construct an undirected graph to represent the board dynamics. I used an adjacency matrix to represent die positions, which was used to construct an adjacency list.

After constructing the adjacency list, testing adjacencies was convenient and predictable.

Implementing the behavior to unselect the most recently selected die seemed to reflect the behavior of a stack, which is what I used to manage the state of die selection.

The remainder of my time was spent mapping the state of the two data structures to the UI, in addition to styling the UI as closely to the spec as possible.

Things I didn't get to, but would want to expand on: caching (convenient for offline), word validation against an English dictionary, and animations that simulate the physical shaking of a Boggle board.

@internetsadboy
internetsadboy / MIPS-Register-Conventions.md
Last active October 27, 2021 09:49
MIPS-Register-Conventions Cheatsheet
Name Register # Usage Preserved on call
$zero 0 The constant value 0 NA
$v0 - $v1 2 - 3 Values for results and expression evaluation F
$a0 - $a3 4 - 7 Arguments F
$t0 - $t7 8 - 15 Temporaries F
$s0 - $s7 16 - 23 Saved T
$t8 - $t9 24 - 25 More temporaries F
$gp 28 Global pointer T
$sp 29 Stack pointer T
/**
* @param {String} str
* @return {Boolean}
*/
function hasQuestionMark (str) {
return /\?/g.test(str);
}
/**
@internetsadboy
internetsadboy / README.md
Last active August 29, 2015 14:11
Viusic Readme

Viusic

BUILD INSTRUCTIONS

  1. Go to our project's website
  2. Click the install button (top-left corner) to retrieve the Viusic.zip file
  3. Extract Viusic.zip to a directory of your choice
  4. Install Eclipse (Skip this step if you already have it)
  5. Open Eclipse
  • Click File
@internetsadboy
internetsadboy / primes.rb
Last active August 29, 2015 14:11
for n => return [p1, p2] ; where n is an even integer and p1 and p2 are two prime integers that summate to n.
require 'prime'
# return two prime numbers that summate to n, where n is an even integer
def primes (n)
if n % 2 != 0
return "[ERROR] not an even number"
end
# identify primes
prs = []
@internetsadboy
internetsadboy / index.html
Created November 15, 2014 16:52
d3: scalable bar chart
<!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">
<meta name="description" content="Scalable Bar Chart Example">
<meta name="author" content="Jared Halpert">
<title>Scalable Bar Chart</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.13/d3.js">