Skip to content

Instantly share code, notes, and snippets.

calmdev

  • FL
Block or report user

Report or block calmdev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@calmdev
calmdev / headless-cms-archive.json
Created Sep 3, 2018
HEADLESSCMS.ORG DATA ARCHIVE
View headless-cms-archive.json
{"timestamp":1535940922035,"data":{"appernetic":[{"timestamp":1535940922035}],"bowtie":[{"timestamp":1535940922035}],"builtio":[{"timestamp":1535940922035}],"butter-cms":[{"timestamp":1535940922035}],"canner":[{"timestamp":1535940922035,"stars":2148,"forks":70,"issues":20}],"cloudcannon":[{"timestamp":1535940922035}],"cloud-cms":[{"timestamp":1535940922035}],"cockpit":[{"timestamp":1535940922035,"stars":3230,"forks":319,"issues":197}],"coisas":[{"timestamp":1535940922035,"stars":249,"forks":19,"issues":0}],"comfortable":[{"timestamp":1535940922035}],"contenta":[{"timestamp":1535940922035,"stars":199,"forks":62,"issues":23}],"contentful":[{"timestamp":1535940922035}],"cosmic-js":[{"timestamp":1535940922035}],"daptin":[{"timestamp":1535940922035,"stars":224,"forks":12,"issues":9}],"datocms":[{"timestamp":1535940922035}],"directus":[{"timestamp":1535940922035,"stars":3371,"forks":346,"issues":91}],"google-drive-cms":[{"timestamp":1535940922035,"stars":197,"forks":13,"issues":11}],"editlayer":[{"timestamp":153594
View pedantically_commented_playbook.yml
---
# ^^^ 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.
View node_running_in_production.md

#Node - Running in Production This gist is based on the excellent post by @hacksparrow which is found at http://www.hacksparrow.com/running-express-js-in-production-mode.html. The main principle is that you want the application to detect that it is running on a production server and to use the production configuration. The way to do this is to set the NODE_ENV=production. To do this you need to do the following:

$ export NODE_ENV=production

But we have a little problem here. The NODE_ENV environment variable will be lost if the server restarts, so it is safer to put it in the .bash_profile file. That way the variable will set again every time the system reboots. You will find the file in your home directory. It's a hidden file, so you can't see it unless you do a ls -la. We will append the export command to the .bash_profile file.

View validation.js
// This validation check works:
user.validate().success(function() {
user.save().success(function(user){
console.log(user);
}).error(function(errors) {
console.log(errors);
});
});
// Still trying to get this isUnique validation method working on my model:
View user.js
sequelize.define('User', {
id: DataTypes.INTEGER,
email: {
type: DataTypes.STRING,
validate: {
isEmail: {
msg: 'Invalid email address.'
}
}
}
You can’t perform that action at this time.