This file contains hidden or 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
| npm config set cache-min 9999999 | |
| CACHE ALL THE THINGS!!! | |
| ─────────────────────────────▄██▄ | |
| ─────────────────────────────▀███ | |
| ────────────────────────────────█ | |
| ───────────────▄▄▄▄▄────────────█ | |
| ──────────────▀▄────▀▄──────────█ | |
| ──────────▄▀▀▀▄─█▄▄▄▄█▄▄─▄▀▀▀▄──█ |
This file contains hidden or 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 Html exposing (text) | |
| main = | |
| text (toString (quicksort [5,3,8,1,9,4,7])) | |
| quicksort : List comparable -> List comparable | |
| quicksort list = | |
| case list of | |
| [] -> | |
| [] |
This file contains hidden or 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 Html exposing (text) | |
| main = | |
| text (toString (mergesort [5,3,8,1,9,4,7])) | |
| {-| Sorts a list of values by: | |
| 1. If the list has zero or one element, it is sorted! | |
| 2. If it is longer, split it into two sublists | |
| 3. Sort those sublists |
This file contains hidden or 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
| S3KEY="my aws key" | |
| S3SECRET="my aws secret" # pass these in | |
| function putS3 | |
| { | |
| path=$1 | |
| file=$2 | |
| aws_path=$3 | |
| bucket='my-aws-bucket' | |
| date=$(date +"%a, %d %b %Y %T %z") |
This file contains hidden or 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
| #!/bin/sh | |
| fancy_echo() { | |
| local fmt="$1"; shift | |
| # shellcheck disable=SC2059 | |
| printf "\n$fmt\n" "$@" | |
| } | |
| append_to_zshrc() { |
This file contains hidden or 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
| fetch('//freegeoip.net/json/').then(r => r.json()).then(r => console.log(r)); |
This file contains hidden or 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
| curl -o /dev/null -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" https://google.com |
This file contains hidden or 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
| #!/bin/bash | |
| # ./ttfb https://www.google.com ~/your-log-file.txt | |
| function ttfb() { | |
| curl -o /dev/null \ | |
| -H 'Cache-Control: no-cache' \ | |
| -s \ | |
| -w "%{time_connect} %{time_starttransfer} %{time_total}" \ | |
| $1 | |
| } |
This file contains hidden or 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
| var t = window.performance.timing; | |
| var interactive = t.domInteractive - t.domLoading; | |
| var dcl = t.domContentLoadedEventStart - t.domLoading; | |
| var complete = t.domComplete - t.domLoading; | |
| console.log('interactive: ' + interactive + 'ms, ' + 'dcl: ' + dcl + 'ms, complete: ' + complete + 'ms'); |
This file contains hidden or 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 fibonacci() func() int { | |
| first, second := 0, 1 | |
| return func() int { | |
| ret := first | |
| first, second = second, first+second | |
| return ret |