Skip to content

Instantly share code, notes, and snippets.

Avatar
🔮
It's magic

Edgar grundmanise

🔮
It's magic
  • Malta
View GitHub Profile
View what-hiring-should-look-like.md

What Hiring Should Look Like

This is definitely not the first time I've written about this topic, but I haven't written formally about it in quite awhile. So I want to revisit why I think technical-position interviewing is so poorly designed, and lay out what I think would be a better process.

I'm just one guy, with a bunch of strong opinions and a bunch of flaws. So take these suggestions with a grain of salt. I'm sure there's a lot of talented, passionate folks with other thoughts, and some are probably a lot more interesting and useful than my own.

But at the same time, I hope you'll set aside the assumptions and status quo of how interviewing is always done. Just because you were hired a certain way, and even if you liked it, doesn't mean that it's a good interview process to repeat.

If you're happy with the way technical interviewing currently works at your company, fine. Just stop, don't read any further. I'm not going to spend any effort trying to convince you otherwise.

View safari-samesite-none.md
@ireade
ireade / sw.js
Last active Aug 19, 2020
Handle broken images with the service worker
View sw.js
self.addEventListener('install', (e) => {
e.waitUntil(
caches.open("precache").then((cache) => cache.add("/broken.png"))
);
});
function isImage(fetchRequest) {
return fetchRequest.method === "GET" && fetchRequest.destination === "image";
}
@authenticsebastian
authenticsebastian / click.js
Created May 16, 2018
Click on unfolded files in Github
View click.js
[].slice.call(document.querySelectorAll('.js-file-header'))
.filter((item) => item.dataset.path.indexOf('{file-name-part}') > -1 && !item.parentNode.classList.contains('Details--on'))
.map((header) => header.querySelector('.js-details-target'))
.forEach((item) => item.click())
View CryptoLambo.sol
pragma solidity ^0.4.11;
// @calvin_claus' contract
// @neuling2k didn't do anything
contract CryptoLambo {
address public dev1;
address public dev2;
@authenticsebastian
authenticsebastian / fizz-buzz.js
Last active Feb 12, 2018
Functional take on FizzBuzz
View fizz-buzz.js
const processNumber = (data, condition, message) => data + (condition ? message : '');
const hasNoRemainder = (number, divider) => number % divider === 0;
const rule = (value, message) => (number, data) =>
processNumber(data, hasNoRemainder(number, value), message);
const rules = [
rule(3, 'Fizz'),
rule(5, 'Buzz')
@bvaughn
bvaughn / eager-prefetching-async-data-example.js
Last active Nov 5, 2020
Advanced example for eagerly prefetching async data in a React component.
View eager-prefetching-async-data-example.js
// This is an advanced example! It is not intended for use in application code.
// Libraries like Relay may make use of this technique to save some time on low-end mobile devices.
// Most components should just initiate async requests in componentDidMount.
class ExampleComponent extends React.Component {
_hasUnmounted = false;
state = {
externalData: null,
};
@authenticsebastian
authenticsebastian / monthsLater.js
Last active Feb 12, 2018
Calculating how many months have passed since given date
View monthsLater.js
const monthsLater = (date, months) =>
[
(dateArg) => new Date(dateArg),
(dateObj) => dateObj.setMonth(dateObj.getMonth() + months),
(timestamp) => new Date(timestamp),
String
].reduce(
(value, fn) => fn(value),
date
);
@heygrady
heygrady / mapDispatchToProps.md
Last active Sep 16, 2020
Redux containers: mapDispatchToProps
View mapDispatchToProps.md

Redux containers: mapDispatchToProps

This document details some tips and tricks for creating redux containers. Specifically, this document is looking at the mapDispatchToProps argument of the connect function from [react-redux][react-redux]. There are many ways to write the same thing in redux. This gist covers the various forms that mapDispatchToProps can take.

@bendc
bendc / raf-boilerplate.js
Created Aug 28, 2017
rAF tutorial: boilerplate code
View raf-boilerplate.js
"use strict";
// animation utils
// ===============
const trackTime = id => {
const [entry] = performance.getEntriesByName(id);
if (!entry) {
performance.mark(id);
You can’t perform that action at this time.