Skip to content

Instantly share code, notes, and snippets.

View lund0n's full-sized avatar

Jeremy Lund lund0n

  • Procore
  • Herriman, UT
View GitHub Profile
@lund0n
lund0n / index.html
Created December 8, 2014 20:30
ng-form: Nesting Forms for Repeating Inputs
<div ng-app="demo" ng-controller="Demo as vm">
<form name="example">
<div>
<label>Your name:
<input type="text" name="name" ng-model="vm.name" required/>
<span ng-show="example.name.$invalid">invalid!</span>
</label>
</div>
<div>Name your three favorite ice cream flavors:</div>
<ul>
@lund0n
lund0n / index.html
Created May 24, 2016 21:09
HTML Layout with scrollable flex box
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
html, body {
height: 100vh;
display: flex;
flex-direction: column;
@lund0n
lund0n / index.js
Created October 8, 2016 04:34
Demonstrate use of CommonJS module in Rollup
// Just a couple of examples from the crypto-js README.
// run with `node bundle.js` after running the rollup build.
import CryptoJS from 'crypto-js';
import SHA256 from 'crypto-js/sha256';
console.log(CryptoJS.HmacSHA1('Message', 'Key'));
console.log(SHA256('Message'));
@lund0n
lund0n / README.md
Last active October 1, 2018 23:03
Converts all styled-components `Component.extend` calls to `styled(Component)` calls
@lund0n
lund0n / index.js
Last active October 17, 2019 15:26
Reports file statistics for the specified directory tree.
#!/usr/bin/env node
const glob = require('glob')
const { bold, cyan, gray, italic, magenta } = require('kleur')
const cwd = process.argv[2] || process.cwd()
const toPercentage = (numerator, denominator) => denominator > 0 ? ((numerator / denominator) * 100) : 0
const stats = Object.entries({
ALL: '**/*.{js,tsx}',
@lund0n
lund0n / adjust-price.js
Created April 22, 2020 16:34
Ramda Example
// from Egghead video: https://egghead.io/lessons/javascript-handle-branching-logic-with-ramda-s-conditional-functions
import * as R from 'ramda'
const products = [
{ name: 'Jeans', price: 80, category: 'clothes' },
{ name: 'Cards', price: 5, category: 'games' },
{ name: 'iPhone', price: 649, category: 'electronics' },
{ name: 'Freakonomics', price: 30, category: 'books' },
]
@lund0n
lund0n / script.sh
Created December 14, 2023 22:28
Get a Changeset summary follow a changeset version
git diff packages/*/CHANGELOG.md | grep -E '^( ?# |\+[^+])' | cut -c 2- | sed 's/^\(#.*\)$/\1\n/' | pbcopy