Skip to content

Instantly share code, notes, and snippets.

View chrisbautista's full-sized avatar
🕶️

Chris Bautista chrisbautista

🕶️
View GitHub Profile
import {assert} from "chai";
import {digitalRoot} from './solution';
describe("solution", () => {
it('should work for fixed tests', () => {
assert.equal(digitalRoot(16), 7);
assert.equal(digitalRoot(195), 6);
assert.equal(digitalRoot(992), 2);
assert.equal(digitalRoot(999999999999), 9);
assert.equal(digitalRoot(167346), 9);
@chrisbautista
chrisbautista / DeadAntCount.test.ts
Last active January 29, 2024 06:25
Dead ant count
import * as solution from './deadAntCount.ts';
import {assert} from "chai";
describe("solution", function(){
it("examples", function(){
assert.equal(solution.deadAntCount("ant ant ant ant"), 0, "Nope");
assert.equal(solution.deadAntCount(null), 0, "Nope2");
assert.equal(solution.deadAntCount("ant anantt aantnt"), 2, "Nope");
assert.equal(solution.deadAntCount("ant ant .... a nt"), 1, "Nope");
@chrisbautista
chrisbautista / Readme.md
Last active January 29, 2024 00:07
Sum without highest and lowest number

Task

Sum all the numbers of a given array ( cq. list ), except the highest and the lowest element ( by value, not by index! ).

The highest or lowest element respectively is a single element at each edge, even if there are more than one with the same value.

Mind the input validation.

Example

{ 6, 2, 1, 8, 10 } => 16
@chrisbautista
chrisbautista / index.html
Created April 19, 2022 02:06
Mobile - Gallery
<!--
Gallery list challenge
- mobile width
- arrow btns
- pages
- styled slides
TODO:
drag/swipe handling
@chrisbautista
chrisbautista / index.html
Created April 19, 2022 01:54
Water droplets
<div class="demo">
<div class="droplet"></div>
<div class="droplet dark-shadow"></div>
<div class="droplet dark-shadow inside-shadow"></div>
<div class="droplet dark-shadow inside-shadow reflection">
</div>
<div class="droplet dark-shadow inside-shadow reflection squish">
</div>
</div>
<div class="card">
<!--
@chrisbautista @codespud
React app to demo extracting color palettes from images using ColorThief. https://lokeshdhakar.com/projects/color-thief/
-->
<div id="app"></div>
@chrisbautista
chrisbautista / animated-bottombar-experiment-css-transitions-only.markdown
Created April 5, 2022 15:09
Animated BottomBar Experiment (CSS Transitions only)
@chrisbautista
chrisbautista / index.html
Created March 29, 2022 17:07
Toy Store Mega Menu
<input type="checkbox" id="reconfigure">
<div class="backdrop"></div>
<div class="stay-young">
Never lose the child in you.<div>🛻🚂🧸</div>
</div>
<div class="burger-menu">
<label for="reconfigure">
<div class="hamburger-menu">
<div class="bar top"></div>
@chrisbautista
chrisbautista / index.html
Created March 15, 2022 04:24
Rock-Paper-Scissors-Lizard-Spock Game
<h1>Sheldon's <div>Rock-Paper-Scissors-</div>
<div>Lizard-Spock</div>
</h1>
<div class="cs-game">
<div class="cs-score">
<div class="cs-score-1">Score: <span>0</span></div>
<div class="cs-spacer"></div>
<div class="cs-score-2">Score: <span>0</span></div>
</div>
@chrisbautista
chrisbautista / animated-main-navigation.markdown
Created February 28, 2022 15:11
Animated - Main Navigation