Skip to content

Instantly share code, notes, and snippets.

View OfTheDelmer's full-sized avatar

Delmer OfTheDelmer

View GitHub Profile

A PolicyResult class to help collect the status and message from a policy check

class PolicyResult

  attr_reader :message, :status

  def initialize(params)
    @status = params.fetch(:status, false)
@OfTheDelmer
OfTheDelmer / queue.md
Last active September 11, 2018 19:48

Interview Prep

Control Flow And Queue's

A queue just preserves the order in which items arrived into it. This helps model real world problems around waiting in your turn or in line.

Directions: Write a ruby script to do the following with a queue.

Scenario: you have a store and you're writing a script to help calculate a quick receipt. The one problem is that every 3rd and 5th item a customer buys is on sale. Every 3rd item is 10% off and every 5th item is 20% off, but also, an item that is both a 3rd and 5th item is 30% off.

<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
.blue {
background-color: blue;
color: white;

Hey everyone,

This is a live coding document created by Stypi that will allow me to share code with you as we discuss materials. You should be seeing these changes as I type.

I'll try to use a markdown style for our discussion so that we can just put this session into the notes repo for reference later. Cool?

Please use the sidebar for chatting

HW Review

Model Associations

@OfTheDelmer
OfTheDelmer / retrospective.md
Last active March 2, 2024 15:09
Retrospective Gist

Lesson Reflection

Directions

Pick one lesson you've given this week, and use it to answer the following questions. Give yourself a moment to reflect upon the following before answering.

  • Organization of lesson notes, does it include the following:
    • an agenda or lesson outline,
    • objectives with action verbs,
  • L.E.A.R.N. component (link, evaluate, active, review, and new),

Warm Up

Compression

After working with random strings of text all day in your office you start to wonder if there is an easier way to store the text. What you end up with is an idea for compression that you want to implement. You decided to replace repeated characters with their count followed by the character, i.e. AAAABBBCD becomes 4A3BCD.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Food Tracker</title>
</head>
<body>
<form id="new_food_item">
<div>
<input type="text" name="food[name]" placeholder="Name">

Warm Up

Word Mix

They say that if you take a sentece and mix all the characters in each word except for the first and last that you'll still be able to read the sentence. Make an algorithm to implement this.

@OfTheDelmer
OfTheDelmer / angular_rails_http.md
Created May 28, 2014 17:53
Introductory outline for managing resources with a Rails Application, reviewing the setup of JSON API, and organizing JS assets.

Angular Rails

Angular $http Object

Objectives
Setting up a JSON API
Controller CRUD Actions

Outline