Skip to content

Instantly share code, notes, and snippets.

View davidalekna's full-sized avatar
💭
🌊🏄‍♂️🏄‍♂️🏄‍♂️

David davidalekna

💭
🌊🏄‍♂️🏄‍♂️🏄‍♂️
  • United Kingdom
View GitHub Profile

Advanced JavaScript Learning Resources

This is a list of advanced JavaScript learning resources from people who responded to this [Tweet][13] and this [Tweet][20].

  • [You Don't Know JS][3]

  • [Frontend Masters courses by Kyle Simpson][12]

  • [@mpjme][6]'s [YouTube videos][5]

@davidalekna
davidalekna / Readme.md
Created September 3, 2017 19:55 — forked from mxstbr/Readme.md
Enable tab completion for JSX with Emmet in Atom

Enable tab completion for JSX with Emmet in Atom

This guide assumes you have the emmet and language-babel packages already installed in Atom

Gif of the tab completion working

  1. Open the keymap.cson file by clicking on Atom -> Keymap… in the menu bar
  2. Add these lines of code to your keymap:
'atom-text-editor[data-grammar~="jsx"]:not([mini])':

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

Frontend Masters: AWS for Frontend Engineers

You should have the following completed on your computer before the workshop:

  • Install the AWS CLI.
  • Have Node.js installed on your system. (Recommended: Use nvm.)
    • Install yarn with brew install yarn.
  • Create an AWS account. (This will require a valid credit card.)
  • Create a Travis CI account. (This should be as simple as logging in via GitHub).
@davidalekna
davidalekna / transform.ts
Last active January 6, 2020 11:20
Transform nested object string and array values with preferred values without mutation
const example = {
name: "hello_world",
children: {
name: "hello_world_2",
something: "hello_world_2",
children: {
someNumberValue: 23213,
name: "hey______whatsup",
children: {
name: "h_e_ll_o_world_2",
@davidalekna
davidalekna / cookies.ts
Last active January 9, 2020 10:54
client cookies get, set and delete
const setCookie = (
name: string,
value: string,
days: number = 7,
path: string = "/"
): void => {
const expires = new Date(Date.now() + days * 864e5).toUTCString();
const cookie = `${name}=${encodeURIComponent(
value
)}; expires=${expires}; path=${path}`;
@davidalekna
davidalekna / machine.js
Created January 22, 2020 12:37
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'card',
initial: 'init',
context: {
complete: false,
trustee: {
// 1 name details form
title: null,
firstName: null,
lastName: null,
@davidalekna
davidalekna / post.resolver.ts
Last active February 20, 2020 10:51
AppSync Lambda Resolver to match Apollo Server flow
// Schema
type Mutation {
addPost(
id: ID!,
author: String!,
title: String,
content: String,
url: String
): Post!
/* http://meyerweb.com/eric/tools/css/reset/
v2.0-modified | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@davidalekna
davidalekna / findDuplicates.ts
Last active December 2, 2020 14:25
findDuplicates in an array of objects
const defaultOptions = {
addError: <T extends { [key: string]: unknown }>(
item: T,
fieldName: string
) => ({
id: item.id,
value: item[fieldName],
}),
};