Skip to content

Instantly share code, notes, and snippets.

@patmifsud
patmifsud / gist:0ea94e6078adf488b7929535e4efd9a9
Last active September 21, 2021 22:18
Warmup 1 - Raindrops. seicr48

Warmup - Raindrops

Write a Javascript program that will take a number (eg 28 or 1755 or 9, etc) and output the following:

  • If the number contains 3 as a factor, output 'Pling'.
  • If the number contains 5 as a factor, output 'Plang'.
  • If the number contains 7 as a factor, output 'Plong'.
  • If the number does not contain 3, 5 or 7 as a factor, output the number as a string.
@patmifsud
patmifsud / sum_of_arrays.md
Last active September 27, 2021 22:45
Sum of arrays

Sum of arrays

Write a function that receives two arguments, both of which are Arrays and sums them. These arrays contain only numbers. You don't know their length and they can contain both integers and floating point numbers.

Example

  [2, 6.4, 3] + [3, 3.6, 2] = 20

Bonus

Create another version of the above function that can accept more than two arrays as the arguments (you don't know the specific number of arguments). Hint - look up 'The arguments object'.

@patmifsud
patmifsud / prize_wheel.md
Last active September 29, 2021 02:16
prize wheel warmup

Prize wheel

Write a function that announces 'Spinning the prize wheel', then randomly chooses a string from the array similar to the one below, and prints it to console.

const prizes = [ "🚗 New car", "🌴 Holiday", "🥁 Drum machine", "❌ You lose"

@patmifsud
patmifsud / allergies.md
Last active October 10, 2021 21:30
Allergies warmup

Allergies Warmup

An allergy test produces a single numeric score which contains the information about all the allergies the person has (that they were tested for).

The list of items (and their value) that were tested are:

  • eggs (1)
  • peanuts (2)
  • shellfish (4)
  • strawberries (8)

Warmup - Raindrops

Write a program using Ruby that will take a number (eg 28 or 1755 or 9, etc) and output the following:

  • If the number contains 3 as a factor, output 'Pling'.
  • If the number contains 5 as a factor, output 'Plang'.
  • If the number contains 7 as a factor, output 'Plong'.
  • If the number does not contain 3, 5, or 7 as a factor, output the number as a string.

Examples

  • 28 has 7 as a factor. In raindrop-speak, this would be a simple "Plong".
@patmifsud
patmifsud / index.html
Created November 20, 2022 23:40
Sprinkles Spiral
<canvas id="canvas"></canvas>
@patmifsud
patmifsud / index.html
Created November 20, 2022 23:47
Sprinkles Spiral
<canvas id="canvas"></canvas>
@patmifsud
patmifsud / index.pug
Created November 25, 2022 04:30
Navigation PageDesign/Lesson
sectio.nav
h1 FRONTEND TRENDS
h3.span.loader
span.m B
span.m E
span.m N
span.m E
span.m F
span.m I
span.m T
@patmifsud
patmifsud / index.html
Created November 25, 2022 04:31
Kanban
<!-- Latest Sortable -->
<script src="//rubaxa.github.io/Sortable/Sortable.js"></script>
<div class="modal-overlay"></div>
<div class="wrap" id="multi">
<div class="dragBox" id="drag1">
<div id="task1" class="task" onclick="expandCard(this, event)">
<div class="cardMini ">
<div class="header color-green"></div>
<div class="content">Task Content...</div>
</div>
@patmifsud
patmifsud / gokebdr.markdown
Last active December 8, 2022 00:05
gOKEbdR