Skip to content

Instantly share code, notes, and snippets.

@challiwill
challiwill / tracker.md
Last active February 18, 2020 01:17
Pivotal Tracker FAQ

TLDR

  • Stories are the beginning of a conversation. It's not a bad idea to chat with the PM when picking up each story to ensure you understand their intentions. Same thing goes for the designs. Never hesitate to chat with the PM/Designer during the delivery of a story to get clarification or propose alternatives that are easier or better.
  • The order or stories in Tracker is set intentionally by the PM. Please pick up the stories one at a time in order.
  • Generally, there should not be multiple started stories with the same owner. If you believe you are in an exception case chat with the PM before picking up a second story.

Index

@branneman
branneman / better-nodejs-require-paths.md
Last active June 29, 2024 16:00
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

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.

Possible solutions

@leommoore
leommoore / Express_Logging.md
Last active August 20, 2021 19:27
Express - Logging

#Express - Logging The express.js node.js web application framework comes with a built-in logging module called logger which is the connect.js logger. It is really handy to enable and you can use it just like any other Express module. app.use(express.logger());

Without any configuration, the logger middleware will generate a detailed log using what is called the default format. The logger actually supports four predefined log formats: default, short ,tiny, and dev. Each of these predefined formats show various amounts of detail. You can specify one of them this way:

app.use(express.logger('dev'));

If you prefer, you can customize the precise details to be logged using the the following options to format the output of the logger:

@robwierzbowski
robwierzbowski / gitcreate.sh
Last active July 2, 2024 15:43
A simple litte script. Create and push to a new github repo from the command line.
#!/bin/bash
# https://gist.github.com/robwierzbowski/5430952/
# Create and push to a new github repo from the command line.
# Grabs sensible defaults from the containing folder and `.gitconfig`.
# Refinements welcome.
# Gather constant vars
CURRENTDIR=${PWD##*/}
GITHUBUSER=$(git config github.user)
@aheckmann
aheckmann / emit.js
Created June 7, 2012 15:25
mongoose update,new,remove events
var mongoose = require('mongoose');
mongoose.connect('localhost', 'testing_emitUpdate');
var Schema = mongoose.Schema;
var schema = new Schema({
name: String
});
// plumbing
schema.pre('save', function (next) {
@fwielstra
fwielstra / api.js
Created June 14, 2011 14:46
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');