Write code that will validate UK postcodes.
You are given a regular expression that validates postcodes (shown in verbose form below):
(GIR\s0AA) |
(
const byte localControlOn[]={0xF0,0x43,0x10,0x7F,0x1C,0x04,0x00,0x00,0x06,0x00,0xF7}; | |
const byte localControlOff[]={0xF0,0x43,0x10,0x7F,0x1C,0x04,0x00,0x00,0x06,0x01,0xF7}; | |
RK002_sendSystemExclusive(11, localControlOn); | |
RK002_sendSystemExclusive(11, localControlOff); |
split --bytes=1024M --filter='gzip > $FILE.gz' /path/to/input /path/to/output |
sudo pip install sshuttle | |
sshuttle -r user@host 0/0 |
$(git rev-parse --show-toplevel) |
curl -s server.com/file | sh |
python -m SimpleHTTPServer 8000 |
#!/bin/bash | |
# In this example checking for directories containing Python files | |
find -iname '*.py' -printf '%h/\n' |
#!/bin/bash | |
# Use \( and \) to create a match group in the find part, use \1 in the replace part to reference the match group. | |
echo "./ThingToMatch/other/stuff/" | sed -n 's/\.\/\([a-zA-Z0-9]*\)\/.*/\1/p' | |
# This will output: ThingToMatch | |
# Works with multiline input, applying the replacement to each line. |
#!/bin/bash | |
# Colours | |
ESC_SEQ="\x1b[" | |
COL_RESET=$ESC_SEQ"39;49;00m" | |
COL_RED=$ESC_SEQ"31;01m" | |
COL_GREEN=$ESC_SEQ"32;01m" | |
COL_YELLOW=$ESC_SEQ"33;01m" | |
COL_BLUE=$ESC_SEQ"34;01m" | |
COL_MAGENTA=$ESC_SEQ"35;01m" |