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
| [{ | |
| "type": "container", | |
| "title": "Registry", | |
| "description": "Docker image registry", | |
| "categories": ["docker"], | |
| "platform": "linux", | |
| "logo": "https://cloudinovasi.id/assets/img/logos/registry.png", | |
| "image": "registry:latest", | |
| "ports": [ | |
| "5000/tcp" |
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
| ### Keybase proof | |
| I hereby claim: | |
| * I am dannycroft on github. | |
| * I am dannycroft (https://keybase.io/dannycroft) on keybase. | |
| * I have a public key ASCOJTYfcKRcaND9PnQqyF-0XeDeh7q8zaU5CgHPWeqYhAo | |
| To claim this, I am signing this object: |
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
| #!/usr/bin/env python3 | |
| ''' A basic bloom filter implementation''' | |
| from bitarray import bitarray | |
| from hashlib import sha256 | |
| import math | |
| def h_i(i, m, s): | |
| ''' | |
| Our "uniformly distributed" hash function: h_i(s) = sha256(s + i) % m |
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 |
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
| #!/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
| 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
| 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
| #!/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
| 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") |