Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
| --- | |
| # ^^^ YAML documents must begin with the document separator "---" | |
| # | |
| #### Example docblock, I like to put a descriptive comment at the top of my | |
| #### playbooks. | |
| # | |
| # Overview: Playbook to bootstrap a new host for configuration management. | |
| # Applies to: production | |
| # Description: | |
| # Ensures that a host is configured for management with Ansible. |
| LOWER(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(TRIM('My String'), ':', ''), ')', ''), '(', ''), ',', ''), '\\', ''), '\/', ''), '\"', ''), '?', ''), '\'', ''), '&', ''), '!', ''), '.', ''), ' ', '-'), '--', '-'), '--', '-')) AS `post_name` |
| #!/bin/sh | |
| # | |
| # ghost - this script starts the ghost blogging package | |
| # | |
| # chkconfig: - 95 20 | |
| # description: ghost is a blogging platform built using javascript \ | |
| # and running on nodejs | |
| # | |
| # Source function library. |
| /** | |
| * @providesModule PatientList | |
| */ | |
| import NavigationBar from 'react-native-navbar'; | |
| import NavigationButtons from 'NavigationButtons'; | |
| import React, { ListView, Navigator, StyleSheet, Text, TextInput, TouchableHighlight, View } from 'react-native'; | |
| import { connect } from 'react-redux/native' | |
| @connect(state => ({ | |
| patients: state.patients |
| var crypto = require('crypto'); | |
| // larger numbers mean better security, less | |
| var config = { | |
| // size of the generated hash | |
| hashBytes: 32, | |
| // larger salt means hashed passwords are more resistant to rainbow table, but | |
| // you get diminishing returns pretty fast | |
| saltBytes: 16, | |
| // more iterations means an attacker has to take longer to brute force an |
| // Restify Server CheatSheet. | |
| // More about the API: http://mcavage.me/node-restify/#server-api | |
| // Install restify with npm install restify | |
| // 1.1. Creating a Server. | |
| // http://mcavage.me/node-restify/#Creating-a-Server | |
| var restify = require('restify'); |
| var cluster = require('cluster'); | |
| if (cluster.isWorker) { | |
| console.log('Worker ' + process.pid + ' has started.'); | |
| // Send message to master process. | |
| process.send({msgFromWorker: 'This is from worker ' + process.pid + '.'}) | |
| // Receive messages from the master process. |
| 'use strict' | |
| const cluster = require('cluster') | |
| const os = require('os') | |
| if (cluster.isMaster) { | |
| let numOfWorkers = os.cpus().length | |
| console.log(`Master cluster setting up ${numOfWorkers} workers..`) | |
| for (let i=0; i < numOfWorkers; i++) { |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
| // Docs/etc. | |
| server.get(null, '/', function(request, response, next) { | |
| response.send(302, null, { | |
| Location: config.siteName + '/docs' | |
| }); | |
| return next(); | |
| }, log.w3c); | |
| server.get(null, '/docs', function(req, res, next) { |