Skip to content

Instantly share code, notes, and snippets.

View AimeeKnight's full-sized avatar
👩‍💻
MLOpsing

Aimee Knight AimeeKnight

👩‍💻
MLOpsing
View GitHub Profile
@AimeeKnight
AimeeKnight / binarySearch.js
Last active November 2, 2015 01:16
Binary Search
/* Returns either the index of the location in the array,
or -1 if the array did not contain the targetValue */
var doSearch = function(array, targetValue) {
var min = 0;
var max = array.length - 1;
var guess;
while(min <= max) {
guess = Math.floor((max + min) / 2);
@AimeeKnight
AimeeKnight / module_pattern.js
Created October 17, 2013 19:21
JavaScript Revealing Module Pattern
var jspy = (function() {
var _count = 0;
var incrementCount = function() {
_count++;
};
var resetCount = function() {
_count = 0;
};
var getCount = function() {
return _count;
@AimeeKnight
AimeeKnight / pre-commit
Created September 25, 2016 22:47
pre commit config hook
#!/bin/sh
if grep -q "port: 80" "gulp/tasks/server/server.js"
then echo "Port number not reverted! Should be set to 3000."
exit 1
fi
@AimeeKnight
AimeeKnight / women_in_tech.md
Last active May 10, 2017 22:12
Women in Tech
  1. Since when are you interested in tech? When was the first contact with tech (parents, school, friends, self-interest etc)?
    I was first exposed to tech in my first job after college. I was working as a project manager at an advertising agency and was working with developers on a daily basis. I was extremely intimidated by what they were working on and in listening to their conversations, but I was also fascinated. From there, I went on to another marketing role where I managed the company’s content management system. It was in that role that I first took the plunge and started to tweak some markup and styles. I was hooked!

  2. Tell us your background - How was your way up to your job today, which different careers have you chosen?
    My background is definitely not traditional! To be honest, computer science didn’t even cross my mind once in college or leading up to it. I spent over 15 years as a competitive figure skater and my plan was to coach for the rest of my life. I loved skating, and I still do bu

@AimeeKnight
AimeeKnight / dark_magic.md
Last active May 17, 2017 20:11
It's Not Dark Magic - Pulling Back the Curtains From Your Stylesheets

Chances are if you're a web developer you're going to have to write some CSS from time to time. When you first looked at CSS it probably seemed like a breeze. You added some border here, changed some colors there. JavaScript was the hard part of front end development! Somewhere during your progression as a front end developer that changed though! What's worse is that many developers in the front end community have simply learned to dismiss CSS as a toy language. The truth however is that when we hit a wall many of us don’t actually understand what our CSS is doing under the hood!

We all like to make jokes about it, but how many of us have actually taken the time to try and understand the CSS we're writing or reading. How many of us have actually reasonably debugged an issue to the next lowest abstraction layer when we hit a wall? Instead, we settle for the first StackOverflow answer, hacks, or we just let the issue go entirely.

All too often developers are left completely puzzled when the browser renders C

@AimeeKnight
AimeeKnight / prototypes.js
Created September 16, 2018 21:46
JS Prototypes
// Every object in Javascript has a prototype. When a messages reaches an object, JavaScript will attempt to find a property in that object first, if it cannot find it then the message will be sent to the object’s prototype and so on. This works just like single parent inheritance in a class based language.
// The __proto__ object
// To understand prototype chains in JavaScript there is nothing as simple as the __proto__ property. Unfortunately __proto__ is not part of the standard interface of JavaScript, not at least until ES6. So you shouldn’t use it in production code. But anyway it makes explaining prototypes easy.
// let's create an alien object
var alien = {
kind: 'alien'
}
body {
line-height: 24px;
font-size: 16px;
box-sizing: border-box;
}
.checkbox input[type="checkbox"] {
opacity: 0;
}
@AimeeKnight
AimeeKnight / findCombinationsFromDictionary.js
Last active November 21, 2018 14:59
Find all combinations in dictionary
function reduceWord(active, rest, subsequences) {
if (!active && !rest) {
return;
}
if (!rest) {
subsequences.push(active);
} else {
reduceWord(active + rest[0], rest.slice(1), subsequences);
reduceWord(active, rest.slice(1), subsequences);
@AimeeKnight
AimeeKnight / PULL_REQUEST_TEMPLATE.md
Last active May 15, 2019 16:44
PR Template .github/

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
@AimeeKnight
AimeeKnight / prototype-examples.js
Last active November 14, 2019 21:56
Prototype Examples
// Every object in Javascript has a prototype.
// When a messages reaches an object, JavaScript will attempt to find a property in that object first,
// if it cannot find it then the message will be sent to the object’s prototype and so on.
// Create an alien object
var alien = {
kind: 'alien'
}
// and a person object