Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "io/ioutil" | |
| "os" | |
| "github.com/containerd/containerd/content/local" | |
| "github.com/containerd/containerd/images" |
The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).
My take-aways are:
You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.
Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse
| # https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c | |
| [metadata] | |
| name = {name} | |
| version = file: {name}/_version.txt | |
| author = Martin Larralde | |
| author_email = [email protected] | |
| url = https://github.com/althonos/{name} | |
| description = {description} | |
| long_description = file: README.md |
This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x
The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: | |
| The above copyright notice and this permission notice shall be included in all | |
| copies or substantial portions of the Software. |
| import java.io.BufferedReader; | |
| import java.io.FileReader; | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.HashMap; | |
| import java.util.List; | |
| import java.util.StringTokenizer; | |
| import java.util.concurrent.atomic.AtomicInteger; | |
| public class AllocHistogram { |
| #WARNING: Use at your own risk. No warranties expressed or implied. YMMV. Drive responsibly. Eat healthy. | |
| #First, `cd` into the parent dir for all of your `sbt`/`maven` projects (I assume you have one of those) | |
| find "$(cd ..; pwd)" -type d -name "target" -print0 | sudo xargs -0 tmutil addexclusion -p |
| #!/bin/bash | |
| # Copyright (c) 2017 Peter Koppstein (pkoppstein at gmail dot com) 2017.01.15 | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| # copies of the Software, and to permit persons to whom the Software is | |
| # furnished to do so, subject to the following conditions: | |
| # |
| #!/usr/bin/env ruby | |
| require 'base64' | |
| require 'nokogiri' | |
| require 'uri' | |
| def main | |
| html = Nokogiri::HTML($stdin.read) | |
| inline_all_images(html) | |
| inline_all_css(html) |