(Swift only)
Easily add entries to Localizable.strings file by copy/pasting code with new NSLocalizedStrings
Usage:
-
Copy your code containing
NSLocalizedString(_:comment:)function calls -
Pipe it through the
pbgenstrings.shscript:
| ''' | |
| Demonstrates that async functions do not run until awaited, unless | |
| they are scheduled otherwise - using asyncio.create_task(...) or similar | |
| Output | |
| ------ | |
| $ python 1_async_sequencing.py | |
| ===== without asyncio.create_task ====== |
| defmodule BugsnagLoggerBackend do | |
| @behaviour :gen_event | |
| @impl true | |
| def init(__MODULE__) do | |
| {:ok, %{}} | |
| end | |
| @impl true | |
| def handle_call({:configure, _options}, state) do |
| #/usr/bin/env bash | |
| echo $(( ($(date -j -f "%d %B %Y" "$(cal -N -e)" +%s) - $(date +%s)) / (24 * 60 * 60) )) days until the Easter bunny comes |
| import java.nio.ByteBuffer; | |
| // is a byte[] under the hood | |
| ByteBuffer buffer1 = ByteBuffer.allocate(12); | |
| // is a block of bytes (similar to malloc) | |
| ByteBuffer buffer2 = ByteBuffer.allocateDirect(12); | |
| // buffers have a "position" that is advanced by read/write operations | |
| buffer1.put((byte)1).put((byte)2).put((byte)3).put((byte)4); |
| apiVersion: batch/v1 | |
| kind: Job | |
| metadata: | |
| generateName: echo-job- | |
| spec: | |
| template: | |
| spec: | |
| containers: | |
| - name: echo | |
| image: alpine:latest |
| import UIKit | |
| import PlaygroundSupport | |
| extension NSNotification.Name { | |
| static let todoListItemUpdated = NSNotification.Name("TodoListItemUpdated") | |
| } | |
| class TodoList { | |
| static let shared = TodoList() |
| import UIKit | |
| import PlaygroundSupport | |
| extension NSNotification.Name { | |
| static let todoListItemUpdated = NSNotification.Name("TodoListItemUpdated") | |
| } | |
| class TodoList { | |
| static let shared = TodoList() |
| #!/bin/bash | |
| # Usage: | |
| # 1. Copy your properties to clipboard | |
| # 2. `pbpaste | swift-default-init.sh | pbcopy` | |
| # 3. Paste into code | |
| set -eu -o pipefail | |
| # Switch to \t for tab indenting |
| #!/bin/bash | |
| set -eu -o pipefail | |
| ## Git BRanchClean (removes local branches that have been merged into the current branch) | |
| # List of branches to ignore separated by vertical bars/pipes (|) | |
| IGNORED_BRANCHES="develop|master" | |
| branches="$(git branch --no-column --no-color --merged | egrep -v '\* ' | sed 's/^[\* ] //' | (egrep -v "$IGNORED_BRANCHES" || true))" |
(Swift only)
Easily add entries to Localizable.strings file by copy/pasting code with new NSLocalizedStrings
Usage:
Copy your code containing NSLocalizedString(_:comment:) function calls
Pipe it through the pbgenstrings.sh script: