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" | |
"crypto/hmac" | |
"crypto/sha1" | |
"encoding/base64" | |
"io" | |
"net/http" | |
"net/http/httptest" |
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
\n\n | |
time_namelookup: %{time_namelookup}s\n | |
time_connect: %{time_connect}s\n | |
time_appconnect: %{time_appconnect}s\n | |
time_pretransfer: %{time_pretransfer}s\n | |
time_redirect: %{time_redirect}s\n | |
time_starttransfer: %{time_starttransfer}s\n | |
--------------------------------------------------\n | |
time_total: %{time_total}s\n |
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
# On MacOS, time has a precision of 6. On Linux (e.g. CI), time is more precise. | |
# | |
# For example: | |
# Linux: Fri, 22 Oct 2021 11:24:40.219256519 UTC +00:00 | |
# MacOS: Fri, 22 Oct 2021 11:24:40.219256000 UTC +00:00 | |
# | |
# This matcher compares time with a precision of 6 decimal places to prevent | |
# time comparison failures in CI. | |
# | |
RSpec::Matchers.define(:eq_time) do |expected| |
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
ssh-keygen -t ed25519 -C "[email protected]" | |
pbcopy < ~/.ssh/id_ed25519.pub |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Hello, World!</title> | |
<link rel="stylesheet" href="stylesheet.css"> | |
</head> | |
<body> | |
Hello, World! | |
<script src="javascript.js"></script> |
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
require 'net/http' | |
require 'json' | |
require 'uri' | |
@token = '' | |
def list_files | |
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago | |
params = { | |
token: @token, |
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
#!/usr/bin/env ruby | |
require 'openssl' | |
data = File.open('blob', 'r:ASCII-8BIT').read | |
c = OpenSSL::Cipher.new('AES-128-ECB') | |
c.decrypt | |
c.key = 'M02cnQ51Ji97vwT4' | |
o = ''.force_encoding('ASCII-8BIT') | |
data.bytes.each_slice(16) { |s| o += c.update(s.map(&:chr).join) } |
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/bash | |
# Please be aware to commit all your changes before; YOU WILL LOSE ALL CHANGES SINCE LAST COMMIT! | |
git rm -r --cached . # This removes everything from the index. | |
git add . # Add everything back using new .gitignore | |
git commit -m ".gitignore is now working" # Commit it! |