<([a-z][a-z0-9]*)[^>]*?(/?)>
| token | explanation |
|---|---|
| < | match < at beginning of tags |
| ( | start capture group $1 - tag name |
| [a-z] | match a through z |
| #!upstart | |
| description "nodemon server for myapp" | |
| author "ubuntu" | |
| start on startup | |
| stop on shutdown | |
| script | |
| export HOME="/home/ubuntu/git/myapp" |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');Those suck for maintenance and they're ugly.
| *.strings utf16 diff=localizablestrings |
| - name: ensure github.com is a known host | |
| lineinfile: | |
| dest: /root/.ssh/known_hosts | |
| create: yes | |
| state: present | |
| line: "{{ lookup('pipe', 'ssh-keyscan -t rsa github.com') }}" | |
| regexp: "^github\\.com" |
| var clipboard = require('child_process').spawn('pbcopy') | |
| , data = 'put whatever data here'; | |
| clipboard.stdin.write(data); | |
| clipboard.stdin.end(); |
###The Issue With Forever Forever is great for running node services, with a minor setback: the word "forever" doesn't apply to system reboots.
###The solution, run node apps as a system service logged in as root
vim /etc/init/node-app.confContents for node-app.conf
| import SimpleHTTPServer | |
| import SocketServer | |
| PORT = 8000 | |
| class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
| pass | |
| Handler.extensions_map['.shtml'] = 'text/html' |
distinct column -> For each row returned, return only the unique members of a set.
Think of it as for each row in a projection, concatenate all the column values and return only the strings that are unique.
test_db=# SELECT DISTINCT parent_id, child_id, id FROM test.foo_table ORDER BY parent_id, child_id, id LIMIT 10;
parent_id | child_id | id
-----------+------------+-----------------------------
1000040 | 103 | 1000040|2645405726|0001|103