Skip to content

Instantly share code, notes, and snippets.

View matthewadowns's full-sized avatar

Matthew Downs matthewadowns

View GitHub Profile
@josephan
josephan / setup_tailwind_in_phoenix.md
Last active August 8, 2023 05:50
Add Tailwind CSS to an Elixir/Phoenix Project with PurgeCSS
@JunSuzukiJapan
JunSuzukiJapan / tasks.json
Created January 20, 2018 10:00
VS Code tasks.json for Elixir/Mix
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "mix compile",
"group": {
"kind": "build",
"isDefault": true
@newyankeecodeshop
newyankeecodeshop / ServingES6.md
Last active June 19, 2021 07:36
Serving ES6 to modern browsers

Background

Recently I noticed that Safari 10 for Mac/iOS had achieved 100% support for ES6. With that in mind, I began to look at the browser landscape and see how thorough the support in the other browsers. Also, how does that compare to Babel and its core-js runtime. According to an ES6 compatability table, Chrome, Firefox, and IE Edge have all surpassed what the Babel transpiler can generate in conjunction with runtime polyfills. The Babel/core-js combination achieves 71% support for ES6, which is quite a bit lower than the latest browsers provide.

It made me ask the question, "Do we need to run the babel es2015 preset anymore?", at least if our target audience is using Chrome, Firefox, or Safari.

It's clear that, for now, we can't create a site or application that only serves ES6. That will exclude users of Internet Explorer and various older browsers running on older iOS and Android devices. For example, Safari on iOS 9 has pretty mediocre ES6 support.

If 2fa is enabled on github switch to ssh instead of https on linux
1. generate an ssh keypair on your linux box
ssh-keygen -t {rsa|dsa}
2. add the public key to github: profile - settings - ssh keys
3. switch from https to ssh
Check your repo remote:
@btroncone
btroncone / ngrxintro.md
Last active February 9, 2024 15:37
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

Full Disclosure: I'm a member of the AVA team

Q: How much faster is AVA than Mocha (tap, tape, ...).

A: It depends.

First things first:

I should start by saying there are lots of reasons to choose AVA, and I don't think speed is (necessarily) the most import one. Other good reasons include:

@monicao
monicao / react.md
Last active February 23, 2021 19:07
React Lifecycle Cheatsheet

React Component Lifecycle

  • getInitialState
  • getDefaultProps
  • componentWillMount
  • componentDidMount
  • shouldComponentUpdate (Update only)
  • componentWillUpdate (Update only)
  • componentWillReceiveProps (Update only)
  • render
@tbassetto
tbassetto / app.ts
Created October 30, 2015 08:39
Angular2 + Material Design Lite
import {bootstrap, Component, Inject, ElementRef, onInit} from 'angular2/angular2';
@Component({
selector: 'my-app',
template: `
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header">
<div class="mdl-layout__header-row">
<!-- Title -->
<span class="mdl-layout-title">Title</span>
@squarism
squarism / iterm2.md
Last active June 2, 2024 09:59
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@chrismccord
chrismccord / gist:ee5ae90b949a9768b871
Last active February 17, 2022 19:34
Phoenix 0.16.x to 0.17.0 upgrade instructions

Deps

Bump your :phoenix and :phoenix_live_reload deps in mix.exs:

def deps do
  [...
   {:phoenix, "~> 0.17"},
   {:phoenix_live_reload, "~> 1.0"},
  ...]