Skip to content

Instantly share code, notes, and snippets.

View gabrielsroka's full-sized avatar

Gabriel Sroka gabrielsroka

View GitHub Profile
@gabrielsroka
gabrielsroka / okta.sh
Created November 29, 2022 18:05
paginate Okta with curl and shell
#!/usr/bin/env bash
# Set these:
url='https://COMPANY.okta.com/api/v1/users'
token='...'
# Pagination code based on https://michaelheap.com/follow-github-link-header-bash
while [ "$url" ]; do
r=$(curl -i --compressed -Ss -H "authorization: SSWS $token" "$url" | tr -d '\r')
headers=$(echo "$r" | sed '/^$/q')
@gabrielsroka
gabrielsroka / exportHNFavorites.js
Last active April 5, 2020 20:17
Export HN Favorites to CSV
/*
Export HN Favorites to CSV.
Setup:
Copy this code to the browser console or, if using Chrome, to a Snippet. For example:
1. Press F12 (Windows) to open DevTools.
2. Go to Sources > Snippets, click New Snippet.
3. Give it a name, eg, "Export HN Favorites".
4. Copy/paste the code from ...
5. Save (Ctrl+S, Windows).
@gabrielsroka
gabrielsroka / metacritic.js
Last active May 30, 2017 00:25
Metacritic
(function () {
var ts = document.getElementsByTagName("table");
for (var t = 0; t < ts.length; t++) {
var at = ts[t];
at.style.width = '100%';
if (at.className == "listtable") {
for (var r = 0; r < at.rows.length; r++) {
var ar = at.rows[r];
for (var c = 1; c < ar.cells.length;c++) {
var ac = ar.cells[c];