-
We have absolutely no idea what we're doing in tech. Please explain the utmost basic things to us.
-
We only do web design. Our whole reason of being in tech is to make things pretty. Consider us the doilies of the industry.
-
We're not laughing about your joke, so we clearly need you explain it to us. In great detail.
-
We're only in tech to find a husband, boyfriend or generally to get laid.
| Add-Type -AssemblyName System.Windows.Forms | |
| while ($true) | |
| { | |
| $Pos = [System.Windows.Forms.Cursor]::Position | |
| $x = ($pos.X % 500) + 1 | |
| $y = ($pos.Y % 500) + 1 | |
| [System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y) | |
| Start-Sleep -Seconds 10 | |
| } |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
The setup of a bluetooth speaker on a Pi Zero W is pretty touchy.
Please get in touch via Twitter @actuino or http://www.actuino.fr/ if you've got comments or improvements to this quick draft.
- Use a solid power source
- check the speaker works on another hardware (android phone f.i.)
- make sure you've updated your Raspbian, install and run rpi-update just in case.
| Rails.application.eager_load! | |
| ActiveRecord::Base.descendants # It returns all models and its attributes. | |
| ApplicationRecord.descendants.collect(&:name) # It returns only the model names |
| apiVersion: v1 | |
| kind: ConfigMap | |
| metadata: | |
| name: example | |
| namespace: default | |
| data: | |
| APPLICATION_HOST: example.com | |
| LANG: en_US.UTF-8 | |
| PIDFILE: /tmp/server.pid | |
| PORT: "3000" |
The set lines
- These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing.
- With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.
set -euxo pipefailis short for:
set -e
set -u
This page collects a set of bash scripting idioms and tools for easy reference.
With -e (errexit), bash exits immediately if an unchecked command exits with a nonzero value.
A checked command is part of a while, until, if, elif, or an expression with && or ||.
Everything else is unchecked.
For a pipeline, only the last command is considered. Adding "or no-op", || :,
ensures a command is safe, e.g., do-something | grep 'may_not_match' || :.
NB. Calling a bash function in a checked context effectively disables -e for all commands in the function.
Use the optional shellcheck, check-set-e-suppressed, to alert on this.