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
module something.com/whatever | |
go 1.19 | |
require github.com/veraison/go-cose v1.1.1-0.20240126165338-2300d5c96dbd | |
require ( | |
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2 // indirect | |
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 // indirect | |
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 // indirect |
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 ( | |
"bytes" | |
"mime/multipart" | |
"net/http" | |
) | |
func PostFormMultipart(content []byte) (*http.Response, error) { | |
url := "http://localhost:8080" |
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
#!/bin/env bash | |
set -e | |
# Generate Cosmos DB authorization header | |
# and create a database in the emulator | |
# HTTP-date | |
# https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1 | |
ISSUE_DATE=$(TZ=GMT date '+%a, %d %b %Y %T %Z') |
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
$ docker exec -it testcontainer /bin/bash | |
[root@18dbc0919c88 /]# |
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 ( | |
"errors" | |
"log" | |
"time" | |
"sync" | |
"fmt" | |
) |
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
var arr = [0,5,7,3,4,9,6,2,1,8]; | |
var ans = [0,1,2,3,4,5,6,7,8,9]; | |
// Split array into smaller chunks recursively [a,b,c,d] => [a,b] and [c,d] | |
// At the bottom (or top of stack) start merging those back | |
// O(NlogN) | |
function mergeSort(a, startIdx, endIdx) { | |
if (startIdx < endIdx) { | |
var mid = Math.floor((startIdx + endIdx)/2); | |
mergeSort(a, startIdx, mid); |
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 config = { | |
region: 'eu-west-1', | |
table: 'MyTableName' | |
}; | |
const AWS = require('aws-sdk'); | |
const ddb = new AWS.DynamoDB({ | |
apiVersion: '2012-08-10', | |
region: config.region | |
}); |
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
# zsh config | |
############### | |
# Load version control information | |
autoload -Uz vcs_info | |
precmd() { vcs_info } | |
# Format the vcs_info_msg_0_ variable | |
zstyle ':vcs_info:git:*' formats '(%b) ' | |
autoload -U colors && colors | |
setopt PROMPT_SUBST |
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
echo "Setup prompt appearance" | |
# to add username@hostname to prompt, then prepend the following: | |
# \[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\] | |
# The promp should look like: | |
# ~/Documents/project $ gitbranch _ | |
export PS1="\[\033[32m\]\w\[\033[00m\] \$ \[\033[34m\]\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\[\033[00m\] " | |
# On FreeBSD and Mac OS X, ls shows colors if the CLICOLOR environment variable is set | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad |
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
# This is a copy/excerpt from Sam Hobbs article | |
# https://samhobbs.co.uk/2016/01/connect-bose-soundtouch-10-wifi-using-linux-telnet | |
# Just making sure it does not dissapear into the void before I need it again | |
# check IP | |
$ route # or "netstat -rn" on osx | |
Kernel IP routing table | |
Destination Gateway Genmask Flags Metric Ref Use Iface | |
default 192.0.2.1 0.0.0.0 UG 600 0 0 wlan0 | |
link-local * 255.255.0.0 U 1000 0 0 wlan0 |
NewerOlder