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
import Data.Char (toUpper) | |
import Data.List (intercalate) | |
import Data.List.NonEmpty (NonEmpty, nonEmpty, toList) | |
import System.Environment (getArgs) | |
data PangramResult = Pangram | MissingLetters (NonEmpty Char) | |
checkPangram :: String -> PangramResult | |
checkPangram s = case nonEmpty missingLetters of | |
Just ls -> MissingLetters ls |
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
#include <unistd.h> | |
#include <pwd.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stddef.h> | |
/** | |
* @file | |
* Utility function to start a shell based on reasonable inferences | |
*/ |
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 | |
import secrets | |
entropy_bytes = 16 | |
print(secrets.token_urlsafe(entropy_bytes)) |
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
data RiskTier = Widespread | Substantial | Moderate | Minimal | |
deriving (Show, Eq) | |
instance Ord RiskTier where | |
compare x y = compare (tierNumber x) (tierNumber y) | |
where | |
tierNumber t = case t of | |
Widespread -> 1 | |
Substantial -> 2 | |
Moderate -> 3 |
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
module StrConv (strConv, charify) where | |
import System.Environment | |
import System.Exit | |
import Data.Char | |
convertStr convertChar = map $ \c -> case convertChar c of | |
Just converted -> converted | |
_ -> c |
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
# This code is dedicated to the public domain under | |
# Creative Commons CC0 1.0 Universal <https://creativecommons.org/publicdomain/zero/1.0/> | |
import base64 | |
import json | |
import sys | |
import zlib | |
shc = input() |
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
%Note on rotation: It may be a good idea to rotate the page when printing, | |
%so that the envelope is in a "portrait" orientation in the printer. | |
%I tried to use lscape to rotate the text, but that doesn't seem to work with textpos. | |
%The solution for now is to use an external tool like pdftk | |
%or the settings in some PDF viewers and printer drivers. | |
%Suggestions on how to achieve proper rotation in TeX are welcome. | |
%Settings | |
%Envelope dimensions (in inches) (US #10 envelopes are 9 1/2 in. x 4 1/8 in.) |
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
# URL in the phishing e-mail is https://t.co/tmI9IHHvTk?signature=newsletter&trackingid=dpx9Ve0JW3iV15k4k4itEmDGAuJQEpNq | |
# Times are UTC-7 | |
$ wget -O /dev/null 'https://t.co/tmI9IHHvTk?signature=newsletter&trackingid=dpx9Ve0JW3iV15k4k4itEmDGAuJQEpNq' | |
--2022-03-18 13:30:42-- https://t.co/tmI9IHHvTk?signature=newsletter&trackingid=dpx9Ve0JW3iV15k4k4itEmDGAuJQEpNq | |
Resolving t.co (t.co)... 104.244.42.133, 104.244.42.197, 104.244.42.69, ... | |
Connecting to t.co (t.co)|104.244.42.133|:443... connected. | |
HTTP request sent, awaiting response... 301 Moved Permanently | |
Location: https://linkedin.com/slink?code=gcfcUq57 [following] | |
--2022-03-18 13:30:42-- https://linkedin.com/slink?code=gcfcUq57 |
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
$ ruby --version | |
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux-gnu] | |
$ irb | |
irb(main):001:0> /\p{Word}/.match?("\u00B2") # Expected to be true based on description of \p{Word} in Regexp docs | |
=> false | |
irb(main):002:0> /\p{Number}/.match?("\u00B2") # U+00B2 is a Number character | |
=> true |
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 | |
# To integrate, place the following into your .gitconfig: | |
# [alias] | |
# sct = !path/to/git-sct.sh | |
if [ $# -lt 1 ]; then | |
echo "Usage: git sct <revision> [<parent-number>]" | |
exit 1 | |
fi |
OlderNewer