Skip to content

Instantly share code, notes, and snippets.

View mooeypoo's full-sized avatar

Moriel Schottlender mooeypoo

View GitHub Profile
@mooeypoo
mooeypoo / sameDigits.js
Last active May 10, 2021 09:49
Given an integer n, return true if n^3 and n have the same set of digits.
// Submission for "rendezvous with cassidoo" interview question of the week
// Subscribe to the newsletter - https://buttondown.email/cassidoo
// NOTE: This isn't the most efficient code... but I had to come up with a smartass method ;)
// Not sure if those will pass me that interview question -- but they're fun to make!
const sameDigits = num => {
const removeDupes = arr => {
return arr
.filter((num, index) => arr.indexOf(num) === index)
}
@mooeypoo
mooeypoo / example.js
Last active March 24, 2019 19:04
An example of creating a custom OOUI widget
/**
* This example shows how to make a quick custom widget that manages its own state in OOUI.
* You can then embed this widget into the DOM or into other widgets, like an OO.ui.PanelLayout
* or an OO.ui.PopupWidget.
*
* This enables you to encapsulate the behavior of your widget, emit your custom events, and
* have the structure of your display be consistent, instead of having to reconstruct things
* over and over in jQuery, managing inputs/buttons/etc and attaching them again independently.
*/
@mooeypoo
mooeypoo / Nova word count
Last active January 9, 2019 22:28
Anodyne Nova Mod - Add a wordcount to mission posts
<?php
/**
* Add word count to Nova mission posts.
* @author Moriel Schottlender mooeypoo@gmail.com
*
* This content should go in the write_missionpost_js.php page in your
* `application/views/_base_override/admin/js/` folder. If the file does not yet exist in
* that folder, you can create it by copy/pasting the entire content of this page
* and saving it as the `write_missionpost_js.php` file.
* If the file already exists, copy over everything between the <script ...> </script>