loading...
willsmart profile picture

willsmart

Coding since 11yo, that makes it over 30 years now ~~~ Have a PhD in Comp Sci ~~~ Love to go on bike tours ~~~ I try to stay as generalist as I can in this crazy wide place coding is at now.

Location NZ Joined Joined on  GitHub logo External link icon
Education

to post-doc

All 94 Comments

re: Daily Challenge #296 - Years to Centuries
Here's a typescript implementation, and a ✨verbose-and-pretty...
re: Daily Challenge #294 - Sum and GCD Practice
Well spotted!
re: Daily Challenge #293 - Name the Operations
Just a quicky in JS ops = [ { name: 'subtraction', op: (a...
re: Daily Challenge #288 - Maze Runner
One with full typing info in typescript... // Input type Ma...
re: Daily Challenge #287 - 16+18=214
Thanks, that's a fair point. Here's the tweaked code: funct...
re: Daily Challenge #287 - 16+18=214
A quickie in Typescript Each digit is enumerated in turn by s...
re: Daily Challenge #286 - Reverse It Quickly!
Nice solution! a=>a.map(a.pop,a) would also work sin...
re: What is a specific recurring challenge you have with CSS?
It ends up being the messy part of the project. Even using SA...
re: Capitalize the first letter of every word
Thanks Mehul
re: Capitalize the first letter of every word
Hey thanks for that, that's awesome! One nice thing about th...
re: Capitalize the first letter of every word
Case conversion can get a bit tricky with edge cases, like do...
re: Weird behaviors of javascript: Primitive Types and Reference Types
I'm signing off the thread btw
re: Weird behaviors of javascript: Primitive Types and Reference Types
A bit of constructive editing... I'm glad we can all agree ...
re: Weird behaviors of javascript: Primitive Types and Reference Types
JS always passes function args by value. const a = somethin...
re: Daily Challenge #282 - Car License Plate Calculator
In JS with toString and a custom radix ended up being pretty ...
re: What design tools do you use?
Love it. Pen and paper is still what feels best for me. The t...
re: I have a joke about X but ...
I have one that's about recursion
re: I have a joke about X but ...
... in fact, I'm not sure you'd get it anyway
re: Daily Challenge #29 - Xs and Os
It's working for me in chrome just now. Try wrapping the outp...
re: Daily Challenge #270 - Fix String Case
Here's a C implementation that does a pretty good job at bein...
re: Solving "Spinal Tap Case" / freeCodeCamp Algorithm Challenges
Well, it's a trade-off. On the one hand "AAAA" is the word "A...
re: Solving "Spinal Tap Case" / freeCodeCamp Algorithm Challenges
No worries, hope it helps! BTW I've updated the main line of...
re: Solving "Spinal Tap Case" / freeCodeCamp Algorithm Challenges
Nice one! This can be made a little cleaner though by using z...
re: Daily Challenge #266 - Who Likes It?
This'd be a good use for template literals. Here's a quicky i...
re: Protecting images on your website
I'm genuinely interested in why you'd do this. What are some ...
re: How do you deal with null vs undefined?
I just use undefined everywhere, and ruthlessly convert nulls...
re: JavaScript: How to Remove Duplicate Values from Arrays
A similar function using Set is function withoutDuplicates(...
re: Daily Challenge #264 - Digital Root
Here's my take on the modulus one, keeping with the nsfw JS s...
re: Daily Challenge #264 - Digital Root
Anytime there's this sort of array summarizing is a good time...
re: Daily Challenge #260 - Subtract the Sum
A quick JS one: First up, set up the base fruit mapping by s...
re: Daily Challenge #254 - The Vowel Code
Cheers
re: Daily Challenge #254 - The Vowel Code
Let's do it in JS using neat little generic HOF... const ...
re: Daily Challenge #25 - Double Cola
Here's a bit of explanation and a rewrite to make the code bl...
re: JavaScript: Double Not Operator?
The bitwise NOT operator can be used as a poor-mans integer c...
re: Daily Challenge #190 - capitalizeFirstLast
Thanks!
re: Daily Challenge #190 - capitalizeFirstLast
An easy option is to start off by lowercasing the whole thi...
re: How would you handle a conversation with someone who thinks "respecting an opinion" means "agreeing with it"?
IMO your personal view of what is correct, true, best-pract...
re: JS Array Manipulation Quirks
As a rule I see charAt/charCodeAt/length for strings as use...
re: Git Workflow: Should the history of commits show the real time of your work?
Like the topic! I just see commits a little units of work,...
re: 4 Dangerous Problems in JavaScript Easily Solved by The Builder Design Pattern
Thanks for a great post! It's a great discussion of why th...
re: ✨ 5 damn easiest soft skills💡 needed to become a 10X🔥...Yes...10X🔥 Software Engineer ✔️
Totally agree! The senior devs I've worked with tend to end...
re: Daily Challenge #123 - Curry me Softly
A simple impl in Typescript... function doCurrishSortOfTh...
re: Classes Rock
I’ve got a useful regex substitution for situations like th...
re: How do you prioritize learning new things?
TBH I find turning the telescope 10x harder than just looki...
re: Daily Challenge #101 - Parentheses Generator
This is another case where dynamic programming is useful. R...
re: 13 useful JavaScript array tips and tricks you should know
Tip 10 has an off-by-one error going on: there's no need to...
re: Daily Challenge #95 - CamelCase Method
I agree with SavagePixie. replace is the way to go if you'r...
re: Daily Challenge #90 - One Step at a Time
So an easy "greedy" implementation isn't going to work for...
re: Daily Challenge #89 - Extract domain name from URL
One in JS hostName is based on a quick reading of the spec...
re: Daily Challenge #84 - Third Angle of a Triangle
BTW the challenge on Kata only tests for valid triangles, ...
re: Daily Challenge #84 - Third Angle of a Triangle
Keeping it simple in bash function thirdAngle { echo $(...
re: Git Workflow: How much change is too much change for one commit for you?
The first line of my commits describes what the change will...
re: Daily Challenge #80 - Longest Vowel Change
The new JS function matchAll is going to be really useful. ...
re: Daily Challenge #79 - Connect Four
One in TypeScript that tracks "groups" of connected pieces ...
re: 5 Great Git CLI Shortcuts
A nice one is alias gdammit='git --amend --no-edit' F...
re: Daily Challenge #77 - Bird Mountain
A TypeScript version using reduces and maps to avoid too mu...
re: Daily Challenge #75 - Set Alarm
How about prolog? A file with one fact should do it... s...
re: Daily Challenge #74 - Free Pizza
Here's one in TypeScript My preferred way of passing bags ...
re: Brag Post
Awesome work! I'm finding it an easier interface than codep...
re: Daily Challenge #63- Two Sum
reduce is good for this one. Here's a JS quickie with O(n) ...
re: Daily Challenge #60 - Find the Missing Letter
A quicky using reduce in JS First up it converts the array...
re: Daily Challenge #57 - BMI Calculator
Fair point Craig, in this case it turns out to be a bunch s...
re: Daily Challenge #57 - BMI Calculator
Let's say you need to run this a few billion times times, t...
re: Debugging Challenge: The cursed default clause
Love it. That's really counterintuitive but makes sense. A...
re: What is the oddest JavaScript behavior?
Fair enough. I didn't mean insane in the sense of completel...
re: What is the oddest JavaScript behavior?
But at least ruby is rigorously consistent OO like that. ...
re: What is the oddest JavaScript behavior?
It makes sense why, but I think it's a pity that 0 === -0...
re: What is the oddest JavaScript behavior?
yep, a good check for an actual object is thing &&amp...
re: Give Your App Slick Name with namae.dev
That's awesome! Bookmarked
re: Daily Challenge #47 - Alphabets
A JS one-liner alphaPosition = s => [...s.toLowerCase(...
re: Daily Challenge #46 - ???
Well, since we're doing cmd things... read s; echo "${s//...
re: Daily Challenge #44 - Mexican Wave
A little JS impl using a regex and matchAll (avail in recen...
re: Daily Challenge #43 - Boardgame Fight Resolver
Sure thing. It's a "don't look behind the curtain" kind of ...
re: Daily Challenge #43 - Boardgame Fight Resolver
I'm surprised no-one has used the age old xor-the-second-bi...
re: Daily Challenge #41 - Greed is Good
JS implementation keeping the rules as data function scor...
re: Daily Challenge #35 - Find the Outlier
A javascript one that has pretty reasonable complexity fu...
re: What is quantum computing?
If you learn best by doing IBM has an interface to an actua...
re: Daily Challenge #29 - Xs and Os
How about a reduce to keep it in one loop? (JS) XO = str =&...
re: Daily Challenge #27 - Unlucky Days
Javascript shorty matchingDayCount = (year, dayOfMonth=13...
re: Daily Challenge #26 - Ranking Position
Just a short one in Javascript Edit: somehow I hadn't not...
re: Daily Challenge #25 - Double Cola
Completely untested one written on a phone in js. I’m guessin...
re: Daily Challenge #24 - Shortest Step
JS using a bit of bitwise math // Wow,.. fancy :| step ...
re: Daily Challenge #21 - Human Readable Time
A functional style one in JS that was fun 😋
re: Daily Challenge #19 - Turn numbers into words
Here's a JS one that goes into the gazillions 🤔
re: Daily Challenge #15 - Stop gninnipS My sdroW!
Nice one! If you replace the trim() with a substring(1) the...
re: Daily Challenge #15 - Stop gninnipS My sdroW!
And one that modifies a string inplace using C #include ...
re: Daily Challenge #15 - Stop gninnipS My sdroW!
JS quickie theString => theString.split(' ').map( w...
re: There are 10 types of people...
There are 10 people in the world, 10% of them understand nu...
re: Daily Challenge #3 - Vowel Counter
JS one that's probably pretty speedy vowelCount = string...
re: Daily Challenge #2 - String Diamond
JS Now with contrast, invertability, custom strings and ot...
re: Daily Challenge #1 - String Peeler
Seat of your pants GNU C printf(“String: %s”, s); printf...
re: Creating Pixel Art with CSS
Such a cool technique! Great post. I noticed you're drawin...
re: The shortest way to conditional insert properties into an object literal
That's awesome. Thanks for posting. I didn't know that the ...
loading...