Skip to content

Instantly share code, notes, and snippets.

@DixieKorley
DixieKorley / git_cheat-sheet.md
Created November 26, 2017 20:13 — forked from davfre/git_cheat-sheet.md
git commandline cheat-sheet
@DixieKorley
DixieKorley / index.html
Created November 27, 2017 10:04
Measure Me
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Measure Me</title>
<link rel="stylesheet" href="style.css">
</head>
<body class="main">
<div>
// Whitespace and tabs have no meaning outside of quotation marks. Tabs help with readability.
//Parentheses help with order of oprations.
2 * 3 + 5; // 11
2 * (3 + 5); // 16
//Concatenation
@DixieKorley
DixieKorley / README-Template.md
Created January 11, 2018 05:26 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@DixieKorley
DixieKorley / hashTable.js
Created January 15, 2018 20:10 — forked from alexhawkins/hashTable.js
A Simple Hash Table in JavaScript
/*HASH TABLE - a dictionary/hash map data structure for storing key/value pairs. Finding
an entry in a hash table takes O(1) constant time(same for 10 as 1 billion items). Whereas
finding an item via binary search takes time proportional to the logarithm of
the item in the list O(logn). Finding an item in a regular old list takes time proportional to
the length of the list O(n). Very slow. Hash Tables = very fast */
var makeHashTable = function(max) {
var storage = [],
hashTableMethods = {
@DixieKorley
DixieKorley / vanilla-js-cheatsheet.md
Created January 22, 2018 03:26 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
@DixieKorley
DixieKorley / RAILS_CHEATSHEET.md
Created May 4, 2018 02:10 — forked from mdang/RAILS_CHEATSHEET.md
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@DixieKorley
DixieKorley / react-bind.md
Created August 11, 2018 02:31 — forked from fongandrew/react-bind.md
Explaining why we bind things in React

Start With This

Before getting to React, it's helpful to know what this does generally in Javascript. Take the following snippet of code. It's written in ES6 but the principles for this predate ES6.

class Dog {
  constructor() {

Notes from SO

Looping

  1. If you're talking about starting over from the beginning of the for loop, there's no way to do that except "manually", for example by wrapping it in a while loop:
should_restart = True
while should_restart:
 should_restart = False
"""With At Most Two Distinct Characters"""
from collections import Counter
def longest_substring_count_at_most_two(s):
counter = Counter()
fast, max_length = 0, 0
for lag, char in enumerate(s):
counter[char] += 1
while len(counter) > 2: