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
// copy paste into the console on a page like | |
(()=>{ | |
const shrinkSpaces = (str) => { return str.replace(/\s+/g, ' '); }; | |
let params = new URL(document.location.toString()).searchParams; | |
console.log(`Start Index: ${params.get('startIndex')}`) | |
const splitOn = ['Order placed', 'Total', 'Ship to', 'Order #', 'View order details', 'View invoice']; | |
const regex = new RegExp(splitOn.join("|"), "g"); | |
const rows = document.querySelectorAll('.order-header'); | |
let csv = ""; | |
rows.forEach((row, idx) => { |
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 | |
# A script to re-run your latest failing workflow for a given Github project | |
# Examples: | |
# | |
# circleci-retry-failing-workflow.bash orgservice | |
# | |
# circleci-retry-failing-workflow.bash lichee | |
if [ $# -eq 0 ]; then |
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
// A fun challenge; make it print your name, instead of mine : ) | |
((G, O)=>O((D, __, LUCK)=>()=>{ | |
console.log("from your friend: "+D(__)(LUCK)); | |
})())("HAVE FUN", | |
(w) => {return w( | |
((window) => ((_)=>_(_))( (($)=>window( ((console)=>$($)(console)))))), | |
((N) => ((L)=> 6 ^ (~~L) ? String.fromCharCode(95-(31 & 924798803 >> 5 * L))+N((~~L)+1) : "\n")), | |
undefined)}); |
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
// Compile with: | |
// gcc ./cmdinfo.c -lm -o cmdinfo | |
#include <stdio.h> /* printf(), fprintf() */ | |
#include <string.h> /* strcmp() */ | |
#include <math.h> /* log10(), ceil() */ | |
// fwd decl to cease warnings | |
int print_arguments(FILE* outf, int argc, char *const *argv); | |
int xxdline(int lineno, char* input, int inputlen, char* outbuf); |
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 ( | |
"fmt" | |
"go/ast" | |
"go/parser" | |
"go/token" | |
"io/fs" | |
"io/ioutil" | |
"log" |
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 | |
# Originally based on ag-replace.sh: | |
# https://gist.github.com/adamryman/1de22e36a14c29da2f41c8512cb86b6d | |
usage() { | |
echo "Usage: $(basename $0) \"THIS\" \"THAT\""; | |
echo "Replaces all instances of THIS with THAT in all files which contain THIS." | |
echo "Additionally, prints each file as that file is modified" | |
exit 1; |
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 | |
usage() { | |
echo "Usage: $(basename $0) \"THIS\" \"THAT\""; | |
echo "Replaces all instances of THIS with THAT in all files which contain THIS." | |
echo "Additionally, prints each file as that file is modified" | |
exit 1; | |
} | |
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 python3 | |
# | |
# Copyright (c) 2022 Leland Batey. All rights reserved. | |
# | |
# This work is licensed under the terms of the MIT license. | |
# For a copy, see <https://opensource.org/licenses/MIT>. | |
""" | |
columnize.py reads column-oriented text data and prints that data as | |
nicely-padded columns to STDOUT. Input data *must* be line-oriented; data that | |
spans multiple lines will not be correctly understood and will not be correctly |
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 python3 | |
# | |
# Copyright (c) 2022 Leland Batey. All rights reserved. | |
# | |
# This work is licensed under the terms of the MIT license. | |
# For a copy, see <https://opensource.org/licenses/MIT>. | |
''' | |
Reads a CSV on stdin and writes a CSV on stdout. The output CSV should be | |
semantically identical to the input CSV, except that each cell will have | |
newline characters ('\n') replaced with an escaped newline ('\\n'). The |
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
''' | |
Timespan is code for visualizing timelines of events. We can show spans of time | |
on a timeline, as well as individual events. | |
The following is example code and what it prints: | |
>>> example_timespans = [ | |
... TimeSpan(1647922287310, 1647922287564, 'A short thing happened'), | |
... TimeSpan(1648123040908, 1648123109165, 'a span of time where things happening'), | |
... ] |
NewerOlder