I hereby claim:
- I am mgamini on github.
- I am mgamini (https://keybase.io/mgamini) on keybase.
- I have a public key whose fingerprint is F7F9 D6C5 D50A 5E9D 6447 6C0C 6220 86F7 FAC2 0231
To claim this, I am signing this object:
defmodule EmailValidator do | |
# ensure that the email looks valid | |
def validate_email(email) when is_binary(email) do | |
case Regex.run(~r/^[\w.!#$%&’*+\-\/=?\^`{|}~]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$/i, email) do | |
nil -> | |
{:error, "Invalid email"} | |
[email] -> | |
try do | |
Regex.run(~r/(\w+)@([\w.]+)/, email) |> validate_email |
// Follow the instructions here: http://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/ | |
// | |
// That'll get you 80% of the way there. Unfortunately, you'll run into CORS and MIMETYPE errors, so make the following changes. | |
// ============================================================ | |
// Your clientside script should actually look like this (jquery example): | |
// ============================================================ | |
var data = {email: "[email protected]"} |
I hereby claim:
To claim this, I am signing this object:
[ | |
{ | |
"id": 1040049997721620500, | |
"created_at": "2018-09-13 01:30:17", | |
"favorites": 1, | |
"retweets": 0, | |
"retweeted": "False", | |
"source": "Hootsuite Inc.", | |
"text": "At Green-Wood, 9/11 victims lie beside New York City legends https://t.co/UP7zE2eeRk https://t.co/Md5ZIVhecC" | |
}, |
["Brooklyn Heights", | |
"Navy Yard", | |
"Admiral's Row", | |
"Cadman Plaza", | |
"Clinton Hill", | |
"Downtown Brooklyn", | |
"Bridge Plaza", | |
"RAMBO", | |
"DUMBO", | |
"Fort Greene", |
// Instructions: | |
// Open the Newsday Saturday Stumper in Firefox: https://www.newsday.com/entertainment/extras/crossword-puzzle-1.6375288 | |
// Click on your selected puzzle to navigate to the puzzle page. | |
// Right-click (option click) anywhere on the puzzle. Select "This Frame -> Show Only This Frame". | |
// This should bring up just the puzzle. | |
// Right-click (option click) and click "Inspect Element". Enter the Console tab. | |
// Paste the code below, and press Enter. Save the text file, and open into Across Lite. | |
// PLEASE NOTE: EXECUTING CODE IN YOUR CONSOLE YOU DON'T UNDERSTAND IS GENERALLY A VERY BAD IDEA. Don't make a habit of this. |
var DOM = { | |
body: document.querySelector('body'), | |
parent: document.createElement('div'), | |
header: document.createElement('p'), | |
answerList: document.createElement('ul'), | |
refreshButton: document.createElement('button'), | |
} | |
DOM.parent.style.cssText = 'display: block; width: 100%; background: #eee; padding: 30px; position: absolute; top: 100%;'; | |
DOM.header.style.marginBottom = '20px'; |
Most team sports have a depth chart (a ranking of each player) for each position they have. For Example in NFL: Ben Roethlisberger is listed as the starting QB and first on the QB depth chart. Landry Jones, his backup is listed as the 2nd person on that depth chart. We want to implement functionality that will manage these depth charts. | |
Data Model | |
Assume player objects look like this. Note that players can be on the depth chart for positions that are not their own. | |
{ | |
"player_id": 1, | |
"name": "Bob", | |
"position": "WR" | |
} | |
Problems to solve (Not all need Completed): |
// Nav to the NYT election page: | |
// https://www.nytimes.com/interactive/2020/11/03/us/elections/results-president.html | |
// Open developer tools | |
// Paste the code below | |
// note: pasting code you don't understand into your browser is very dangerous. | |
// If you don't understand what this code is doing, don't do it. | |
const POP_OF_WYOMING = 578759 | |
window.alert(`Biden is winning by ${([...document.querySelectorAll('.e-all-text')].reduce((arr, node) => Math.abs(arr - parseInt(node.innerText.replaceAll(',',''))), 0) / POP_OF_WYOMING).toFixed(2)} Wyomings`) |
var DOM = { | |
body: document.querySelector('body'), | |
parent: document.createElement('div'), | |
header: document.createElement('p'), | |
answerList: document.createElement('ul'), | |
refreshButton: document.createElement('button'), | |
} | |
DOM.parent.style.cssText = 'display: block; width: 100%; background: #eee; padding: 30px; position: absolute; top: 100%;'; | |
DOM.header.style.marginBottom = '20px'; |