Convention over configuration REST API client for Objective-C
Changes the current Xcode
Swift language server extension using sourcekit-lsp for coc.nvim.
klaaspieter/cappuccino-comparisons 9
A collection of Cappuccion vs Cocoa comparison applications
Automatically nib2cib changed nibs in a directory
Testing some issue stuff.
My personal website
Aristo Artwork Files
Simple static site generator using Django templates.
Web Application Framework in JavaScript and Objective-J
push eventcalleerlandsson/Tofu
commit sha 68b0530729c8a1f9199355dc18ec21c983b3dddc
Remove unused icons
push time in 5 hours
pull request commentcalleerlandsson/Tofu
Hey @FIGBERT, would you mind adding this as a PNG to IssuerIcons/ instead without rounded corners. Also, feel free to add a larger size (I've been using 1024x1024) as this gives us some flexibility if we end up wanting to show icons in a larger size. Thanks!
comment created time in 5 hours
push eventcalleerlandsson/Tofu
commit sha 3a159f77de229c7ef589c42bfb40576989317be1
Add source files for, and update, a bunch of icons
push time in 5 hours
PR closed calleerlandsson/Tofu
After our discussion on #52, I spent some time implementing the automated icon generation we discussed. The bash script uses sips – which ships with macOS – and ag – an ack alternative that you can install with Homebrew – to generate the icon files.
The one missing feature that we discussed is removing the hard-coded rounded corners, but that can be implemented in another pull request.
pr closed time in 11 hours
pull request commentcalleerlandsson/Tofu
Move Icon Creation to GenerateIssuerIconAssets.sh
Merged as d6b4544f7a996fd2c7a4feaa77cdee7735240749 and 174fcf569a874472365a47e24b050eec0e4a86e9 with some small modifications:
- I removed the comment about the regex since it was describing the old one.
- I removed some empty lines
- I brought back the unoptimized versions of all icons and re-ran the script. Xcode automatically runs all pngs through pngcrush as part of the build. Not optimizing the icons output by the script avoids having to re-optimize them everytime the script is run to avoid binary diffs.
Thanks so much @FIGBERT and @ThinkChaos!
comment created time in 11 hours
push eventcalleerlandsson/Tofu
commit sha d6b4544f7a996fd2c7a4feaa77cdee7735240749
Add .DS_Store to .gitignore
commit sha 174fcf569a874472365a47e24b050eec0e4a86e9
Replace IssuerIcons.sketch with pngs and a script GenerateIssuerIconAssets.sh will generate icons of the right sizes and as well as theri xcassets imagesets.
push time in 11 hours
Directly translate markdown file using Azure Text Translate Api
fork in 2 days
fork orta/TypeScript-Website-Localizations
A repo for the TypeScript Website localizations
fork in 2 days
fork orta/vscode-browser-preview
A real browser preview inside your editor that you can debug.
fork in 5 days
pull request commentcalleerlandsson/Tofu
Move Icon Creation to GenerateIssuerIconAssets.sh
Alright, all suggestions implemented. Thanks to @ThinkChaos for the RegEx and directory pointers. Probably should squash before merging.
comment created time in 6 days
issue commentcalleerlandsson/Tofu
Add option to change color of "icons"
That would definitely be better, I was just wondering if it would be easy to implement and it would match how you're able to change the background color for contacts in iOS

comment created time in 6 days
Pull request review commentcalleerlandsson/Tofu
Move Icon Creation to GenerateIssuerIconAssets.sh
+#!/usr/bin/env bash+set -euo pipefail++command -v ag >/dev/null 2>&1 || { echo >&2 "I require The Silver Searcher (ag) but it's not installed. Aborting."; exit 1; }+command -v sips >/dev/null 2>&1 || { echo >&2 "I require sips but it's not installed. Aborting."; exit 1; }++get_name() {+ # RegEx Explanation:+ # Positive Lookbehind -- (?<=\.\/IssuerIcons\/)+ # Asserts that the selected portion must be preceeded by ./IssuerIcons/+ # Pattern Match -- .*+ # Matches all characters, excluding newlines, of any length+ # Positive Lookforward -- (?=\.png)+ # Asserts that the selected portion must be followed by .png+ echo $1 | ag --only-matching '(?<=\.\/IssuerIcons\/).*(?=\.png)'
I'd recommend dropping ag for something which comes preinstalled.
Here's an example with sed:
$ echo ./IssuerIcons/a-name.png | sed -E 's:\./IssuerIcons/(.+)\.png:\1:'
a-name
I'd even go as far as removing the directory name from the regex like so: sed -E 's:.+/(.+)\.png:\1:'
comment created time in 6 days
Pull request review commentcalleerlandsson/Tofu
Move Icon Creation to GenerateIssuerIconAssets.sh
+#!/usr/bin/env bash+set -euo pipefail++command -v ag >/dev/null 2>&1 || { echo >&2 "I require The Silver Searcher (ag) but it's not installed. Aborting."; exit 1; }+command -v sips >/dev/null 2>&1 || { echo >&2 "I require sips but it's not installed. Aborting."; exit 1; }++get_name() {+ # RegEx Explanation:+ # Positive Lookbehind -- (?<=\.\/IssuerIcons\/)+ # Asserts that the selected portion must be preceeded by ./IssuerIcons/+ # Pattern Match -- .*+ # Matches all characters, excluding newlines, of any length+ # Positive Lookforward -- (?=\.png)+ # Asserts that the selected portion must be followed by .png+ echo $1 | ag --only-matching '(?<=\.\/IssuerIcons\/).*(?=\.png)'+}++write_json() {+ # JSON copied from Xcode output+ echo -n "{
Using a heredoc would make this cleaner:
cat << EOF
{
"example": "$1"
}
EOF
You won't have to escape the quotes, and you still get variable expansion!
To redirect the output:
cat << EOF > output
...
EOF
comment created time in 6 days
Pull request review commentcalleerlandsson/Tofu
Move Icon Creation to GenerateIssuerIconAssets.sh
+#!/usr/bin/env bash+set -euo pipefail++command -v ag >/dev/null 2>&1 || { echo >&2 "I require The Silver Searcher (ag) but it's not installed. Aborting."; exit 1; }+command -v sips >/dev/null 2>&1 || { echo >&2 "I require sips but it's not installed. Aborting."; exit 1; }++get_name() {+ # RegEx Explanation:+ # Positive Lookbehind -- (?<=\.\/IssuerIcons\/)+ # Asserts that the selected portion must be preceeded by ./IssuerIcons/+ # Pattern Match -- .*+ # Matches all characters, excluding newlines, of any length+ # Positive Lookforward -- (?=\.png)+ # Asserts that the selected portion must be followed by .png+ echo $1 | ag --only-matching '(?<=\.\/IssuerIcons\/).*(?=\.png)'+}++write_json() {+ # JSON copied from Xcode output+ echo -n "{+ \"images\" : [+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}.png\",+ \"scale\" : \"1x\"+ },+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}@2x.png\",+ \"scale\" : \"2x\"+ },+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}@3x.png\",+ \"scale\" : \"3x\"+ }+ ],+ \"info\" : {+ \"version\" : 1,+ \"author\" : \"xcode\"+ }+}" > "${2}"+}++for file in ./IssuerIcons/*.png; do+ name="$(get_name $file)"+ echo "Generating icon for ${name}"+ imageset="./Tofu/Assets.xcassets/${name}.imageset/"+ mkdir -p "$imageset"+ sips --resampleWidth 192 "$file" --out "${imageset}${name}@3x.png" &>/dev/null
Is there a reason to also redirect STDERR? (&> vs >)
I feel like this could lead to hard debugging later on.
comment created time in 6 days
Pull request review commentcalleerlandsson/Tofu
Move Icon Creation to GenerateIssuerIconAssets.sh
+#!/usr/bin/env bash+set -euo pipefail++command -v ag >/dev/null 2>&1 || { echo >&2 "I require The Silver Searcher (ag) but it's not installed. Aborting."; exit 1; }+command -v sips >/dev/null 2>&1 || { echo >&2 "I require sips but it's not installed. Aborting."; exit 1; }++get_name() {+ # RegEx Explanation:+ # Positive Lookbehind -- (?<=\.\/IssuerIcons\/)+ # Asserts that the selected portion must be preceeded by ./IssuerIcons/+ # Pattern Match -- .*+ # Matches all characters, excluding newlines, of any length+ # Positive Lookforward -- (?=\.png)+ # Asserts that the selected portion must be followed by .png+ echo $1 | ag --only-matching '(?<=\.\/IssuerIcons\/).*(?=\.png)'+}++write_json() {+ # JSON copied from Xcode output+ echo -n "{+ \"images\" : [+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}.png\",+ \"scale\" : \"1x\"+ },+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}@2x.png\",+ \"scale\" : \"2x\"+ },+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}@3x.png\",+ \"scale\" : \"3x\"+ }+ ],+ \"info\" : {+ \"version\" : 1,+ \"author\" : \"xcode\"+ }+}" > "${2}"+}++for file in ./IssuerIcons/*.png; do
Maybe adding cd "$(dirname "$0")" at the top of the script to ensure the working directory is always as expected is easier.
comment created time in 6 days
Pull request review commentcalleerlandsson/Tofu
Move Icon Creation to GenerateIssuerIconAssets.sh
+#!/usr/bin/env bash+set -euo pipefail++command -v ag >/dev/null 2>&1 || { echo >&2 "I require The Silver Searcher (ag) but it's not installed. Aborting."; exit 1; }+command -v sips >/dev/null 2>&1 || { echo >&2 "I require sips but it's not installed. Aborting."; exit 1; }++get_name() {+ # RegEx Explanation:+ # Positive Lookbehind -- (?<=\.\/IssuerIcons\/)+ # Asserts that the selected portion must be preceeded by ./IssuerIcons/+ # Pattern Match -- .*+ # Matches all characters, excluding newlines, of any length+ # Positive Lookforward -- (?=\.png)+ # Asserts that the selected portion must be followed by .png+ echo $1 | ag --only-matching '(?<=\.\/IssuerIcons\/).*(?=\.png)'+}++write_json() {+ # JSON copied from Xcode output+ echo -n "{+ \"images\" : [+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}.png\",+ \"scale\" : \"1x\"+ },+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}@2x.png\",+ \"scale\" : \"2x\"+ },+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}@3x.png\",+ \"scale\" : \"3x\"+ }+ ],+ \"info\" : {+ \"version\" : 1,+ \"author\" : \"xcode\"+ }+}" > "${2}"+}++for file in ./IssuerIcons/*.png; do
Thanks! If it's a hassle, I'm not sure it's worth it!
comment created time in 6 days
issue commentcalleerlandsson/Tofu
Add option to change color of "icons"
Hi @tycm, thanks for the suggestion! My goal is to one day support user provided issuer icons. Maybe that can serve the same purpose as custom colored letters and backgrounds?
comment created time in 6 days
Pull request review commentcalleerlandsson/Tofu
Move Icon Creation to GenerateIssuerIconAssets.sh
+#!/usr/bin/env bash+set -euo pipefail++command -v ag >/dev/null 2>&1 || { echo >&2 "I require The Silver Searcher (ag) but it's not installed. Aborting."; exit 1; }+command -v sips >/dev/null 2>&1 || { echo >&2 "I require sips but it's not installed. Aborting."; exit 1; }++get_name() {+ # RegEx Explanation:+ # Positive Lookbehind -- (?<=\.\/IssuerIcons\/)+ # Asserts that the selected portion must be preceeded by ./IssuerIcons/+ # Pattern Match -- .*+ # Matches all characters, excluding newlines, of any length+ # Positive Lookforward -- (?=\.png)+ # Asserts that the selected portion must be followed by .png+ echo $1 | ag --only-matching '(?<=\.\/IssuerIcons\/).*(?=\.png)'+}++write_json() {+ # JSON copied from Xcode output+ echo -n "{+ \"images\" : [+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}.png\",+ \"scale\" : \"1x\"+ },+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}@2x.png\",+ \"scale\" : \"2x\"+ },+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}@3x.png\",+ \"scale\" : \"3x\"+ }+ ],+ \"info\" : {+ \"version\" : 1,+ \"author\" : \"xcode\"+ }+}" > "${2}"+}++for file in ./IssuerIcons/*.png; do
In its current form the relative paths rely on the current working directory. I've implemented the other suggested changes, I'll take a look into this tomorrow – have to figure out how to make it work with the RegEx.
comment created time in 6 days
issue commentcalleerlandsson/Tofu
TOTP with 12 digits causes crash
Sorry about that @eender. I'll look at it whenever I get a chance.
comment created time in 6 days
pull request commentcalleerlandsson/Tofu
Move Icon Creation to GenerateIssuerIconAssets.sh
I have a branch locally with quite a few icons without rounded corners and code to round them at runtime. Will post a PR with it as soon as I've had time to clean it up somewhat!
comment created time in 6 days
Pull request review commentcalleerlandsson/Tofu
Move Icon Creation to GenerateIssuerIconAssets.sh
+#!/usr/bin/env bash+set -euo pipefail++command -v ag >/dev/null 2>&1 || { echo >&2 "I require The Silver Searcher (ag) but it's not installed. Aborting."; exit 1; }+command -v sips >/dev/null 2>&1 || { echo >&2 "I require sips but it's not installed. Aborting."; exit 1; }++get_name() {+ # RegEx Explanation:+ # Positive Lookbehind -- (?<=\.\/IssuerIcons\/)+ # Asserts that the selected portion must be preceeded by ./IssuerIcons/+ # Pattern Match -- .*+ # Matches all characters, excluding newlines, of any length+ # Positive Lookforward -- (?=\.png)+ # Asserts that the selected portion must be followed by .png+ echo $1 | ag --only-matching '(?<=\.\/IssuerIcons\/).*(?=\.png)'+}++write_json() {+ # JSON copied from Xcode output+ echo -n "{+ \"images\" : [+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}.png\",+ \"scale\" : \"1x\"+ },+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}@2x.png\",+ \"scale\" : \"2x\"+ },+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}@3x.png\",+ \"scale\" : \"3x\"+ }+ ],+ \"info\" : {+ \"version\" : 1,+ \"author\" : \"xcode\"+ }+}" > "${2}"+}++for file in ./IssuerIcons/*.png; do
Do these relative paths rely on the current working directory from which the script is run? Do you think it would be possible to make them relative to the location of the script instead? Maybe using BASH_SOURCE?
comment created time in 6 days
Pull request review commentcalleerlandsson/Tofu
Move Icon Creation to GenerateIssuerIconAssets.sh
+#!/usr/bin/env bash+set -euo pipefail++command -v ag >/dev/null 2>&1 || { echo >&2 "I require The Silver Searcher (ag) but it's not installed. Aborting."; exit 1; }+command -v sips >/dev/null 2>&1 || { echo >&2 "I require sips but it's not installed. Aborting."; exit 1; }++get_name() {+ # RegEx Explanation:+ # Positive Lookbehind -- (?<=\.\/IssuerIcons\/)+ # Asserts that the selected portion must be preceeded by ./IssuerIcons/+ # Pattern Match -- .*+ # Matches all characters, excluding newlines, of any length+ # Positive Lookforward -- (?=\.png)+ # Asserts that the selected portion must be followed by .png+ echo $1 | ag --only-matching '(?<=\.\/IssuerIcons\/).*(?=\.png)'+}++write_json() {+ # JSON copied from Xcode output+ echo -n "{+ \"images\" : [+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}.png\",+ \"scale\" : \"1x\"+ },+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}@2x.png\",+ \"scale\" : \"2x\"+ },+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}@3x.png\",+ \"scale\" : \"3x\"+ }+ ],+ \"info\" : {+ \"version\" : 1,+ \"author\" : \"xcode\"+ }+}" > "${2}"+}++for file in ./IssuerIcons/*.png; do+ name="$(get_name $file)"+ echo "Generating icon for ${name}"+ imageset="./Tofu/Assets.xcassets/${name}.imageset/"+ (mkdir "$imageset" || true) 2>/dev/null
Could this use mkdir -p?
mkdir -p "$imageset"
comment created time in 6 days
Pull request review commentcalleerlandsson/Tofu
Move Icon Creation to GenerateIssuerIconAssets.sh
+#!/usr/bin/env bash+set -euo pipefail++command -v ag >/dev/null 2>&1 || { echo >&2 "I require The Silver Searcher (ag) but it's not installed. Aborting."; exit 1; }+command -v sips >/dev/null 2>&1 || { echo >&2 "I require sips but it's not installed. Aborting."; exit 1; }++get_name() {+ # RegEx Explanation:+ # Positive Lookbehind -- (?<=\.\/IssuerIcons\/)+ # Asserts that the selected portion must be preceeded by ./IssuerIcons/+ # Pattern Match -- .*+ # Matches all characters, excluding newlines, of any length+ # Positive Lookforward -- (?=\.png)+ # Asserts that the selected portion must be followed by .png+ echo $1 | ag --only-matching '(?<=\.\/IssuerIcons\/).*(?=\.png)'+}++write_json() {+ # JSON copied from Xcode output+ echo -n "{+ \"images\" : [+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}.png\",+ \"scale\" : \"1x\"+ },+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}@2x.png\",+ \"scale\" : \"2x\"+ },+ {+ \"idiom\" : \"universal\",+ \"filename\" : \"${1}@3x.png\",+ \"scale\" : \"3x\"+ }+ ],+ \"info\" : {+ \"version\" : 1,+ \"author\" : \"xcode\"+ }+}" > "${2}"+}++for file in ./IssuerIcons/*.png; do+ name="$(get_name $file)"+ echo "Generating icon for ${name}"+ imageset="./Tofu/Assets.xcassets/${name}.imageset/"+ (mkdir "$imageset" || true) 2>/dev/null+ cp "$file" "${imageset}${name}@3x.png"
What do you think of using sips here as well, with a size of 192? That way, icons in IssueIcons could be any larger size.
comment created time in 6 days
pull request commentcalleerlandsson/Tofu
Move Icon Creation to GenerateIssuerIconAssets.sh
Wow, that's super cool! Thanks so much for working on this! I'll read through the script and post feedback inline.
comment created time in 6 days
PR opened calleerlandsson/Tofu
After our discussion on #52, I spent some time implementing the automated icon generation we discussed. The bash script uses sips – which ships with macOS – and ag – an ack alternative that you can install with Homebrew – to generate the icon files.
The one missing feature that we discussed is removing the hard-coded rounded corners, but that can be implemented in another pull request.
pr created time in 7 days
push eventsketch-hq/svgo-compressor
commit sha 457d738893e1ab23f4b685ecf40ae2ce471d0e0d
Removed TODO comments
push time in 7 days
startedklaaspieter/chxcode
started time in 8 days
issue openedcalleerlandsson/Tofu
Add option to change color of "icons"
It'd be nice to be able to change the color of the letter and background for items without an icon.
created time in 9 days