This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const easeModifier = (t) => { | |
return t > 0.5 ? 4 * Math.pow(t - 1, 3) + 1 : 4 * Math.pow(t, 3); | |
} | |
const createPositionsArray = (numFrames, totalDistance, pagePosition) => { | |
return new Array(numFrames + 1).fill(null).map((x, i) => { | |
const progress = i / numFrames; | |
const incrementDistance = easeModifier(progress) * totalDistance; | |
return pagePosition + (incrementDistance); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactTestUtils, { act } from 'react-dom/test-utils'; | |
import ReactDOM from 'react-dom'; | |
import TestRenderer from 'react-test-renderer'; | |
import { Pill } from 'seek-style-guide/react'; | |
import SkillsForm from './SkillsForm'; | |
const defaultProps = { | |
initialSkills: [], | |
onChange: () => {}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lodash (gzip) | lodash-es (gzip) | lodash.utility (gzip) | ||
---|---|---|---|---|
1 utility | 1.2 | 0.61 | 0.92 | |
3 utilities | 6.74 | 6.03 | 3.57 | |
5 utilities | 6.76 | 6.03 | 3.77 | |
10 utilities | 8.2 | 6.81 | 7.15 | |
15 utilities | 13.97 | 12.59 | 14.3 | |
20 utilities | 14.33 | 12.89 | 18.82 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Swallow error output | |
npm run postrelease 2>/dev/null || echo "postrelease script" | |
# Basic if statements | |
if [ $1 -gt 100 ] | |
then | |
echo Hey that\'s a large number. | |
pwd | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
type Rect struct { | |
width int | |
height int | |
} | |
func (r *Rect) PrintArea() string { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (r rect) perim() float64 { | |
return 2*r.width + 2*r.height | |
} | |
// This means implementing perim on rect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func Atoi(s string) (int, error) | |
// (int, error) means its returning a tuple of type int, and error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
a := 10 | |
b := &a // &a is the reference of a | |
c := a | |
fmt.Println(a, b, *b, c) // *b means the value this reference is pointing to (dereference the value) | |
// 10 0xc0000160a0 10 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
// make a slice, without starting length off 0 | |
s := make([]string, 0) | |
// above is same as | |
// s := []string{} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in github.com/chardos/leftpad/leftpad.go | |
package leftpad | |
import ( | |
"strings" | |
"unicode/utf8" | |
) | |
// This variable name is lowercase, so it's package-visible |
NewerOlder