Bits


Today-I-learned liked micro-posts. (may move to Posts)

On this page:


Search Box

Search & Deploy now has a search box powered by DuckDuckGo. Rather than embedding an iframe we’ve opted for adding an actual form.

<form class="search-box" method="get" action="https://duckduckgo.com/">
  <input type="hidden" name="sites" value="search-and-deploy.gitlab.io">
  <input type="hidden" name="kh" value="1">
  <input type="hidden" name="kg" value="p">
  <input type="hidden" name="k1" value="-1">
  <input type="hidden" name="k7" value="#f4f5f6">
  <input type="hidden" name="k8" value="#373f51">
  <input type="hidden" name="k9" value="#006394">
  <input type="text" name="q" maxlength="255">
  <input type="submit" value="Search">
</form>

For privacy sake we’ve

  • omit the partnership param (t).
  • turn HTTPS on (kh=1)
  • use the address bar as POST (kg=p)
  • turned ads off (k1=-1)

Read more on the hidden params


macOS IPv6 off

On macOS we can turn Wi-Fi’s IPv6 off from the terminal:

$ networksetup -setv6off Wi-Fi

If prompted, we need to authorize with our password.


Ruby blocks

In Ruby we can write blocks either pairing doend or {}. Although, at times, is necessary to switch one for the other. We may consider them syntactically equivalent, and restrict their use to show their intent.

We can show a block’s functional intent by using {}. That is, when we care about the block’s returned value, but also that it doesn’t change the system’s state.

When the block mutates the system’s state, and we don’t care about the returned value, we’d use doend.

If a block is doing both, returning a significant value and changing the state of the system, consider separating any commands from queries being made.


Loading Times

End-user machine times, as opposed to developer machine times

A typical Ruby MVC app takes

Server response time Status
Avg < 50 ms Fast
50 ms > Avg < 300 ms Avg
Avg >= 300 ms Slow

For the front,

Browser load time Status
Avg < 500 ms Fast
500 ms >= Avg < 2 s Avg
Avg >= 2 s Slow

Simple JSON API servers take

Server response time Status
Avg < 25 ms Fast
25 ms > Avg < 150 ms Avg
Avg >= 150 ms Slow

Feed Changes

A brief notice for receiving this via RSS.

With all the changes this little site has been through lately, we forgot to mention that we have effectively moved our feed from a RSS to Atom.

If you subscribed to S&D’s Feed before July 22nd you’ll stop receiving new posts, and bits on October 1st.

You can already subscribe to our new Atom feed. Simply add https://search-and-deploy.gitlab.io/atom.xml to your reader.


Download Integrity

Some FLOSS provide md5 hashes to verify the integrity of the what we are about to download (installers, source code, etc.). On macOS, using ZSH, we can validate the integrity of our file with:

$ [ "$(md5 -q /path/to/file)" = "c7537c3cf1d5d2fc2b744af8025c0cf3" ] && (echo "valid")

Where c7537c3cf1d5d2fc2b744af8025c0cf3 would be the md5 hash provided by the developers.


Firefox Update

Updated bit

We used to delete Activity Stream, Pocket, and Follow on Search extensions for Firefox Developer Edition to actually disable them.

Since 63.07b none are longer available at their usual location. Instead, they are now controlled via the about:config page.

Check out this repo for our opinionated Firefox settings, and sample user.js file, which disables the extensions mentioned above, among other things.


Deprecated Bit

According to the archilinux wiki we can safely remove a few hidden add-ons which firefox includes by default. Beware, doing so will only remove these features until next update.

  • activity stream. ‘new tab’ page replacement.
  • pocket. proprietary freemium service add-on.
  • follow on search. search telemetry.

on macOS:

$ cd /Applications/FirefoxDeveloperEdition.app/Contents/Resources/browser/features

once there, remove the hidden add-ons simply by:

$ rm activity-stream@mozilla.org.xpi firefox@getpocket.com.xpi followonsearch@mozilla.com.xpi