Skip to content

Instantly share code, notes, and snippets.

View dknell's full-sized avatar

David Knell dknell

View GitHub Profile
@aheckmann
aheckmann / storeImgInMongoWithMongoose.js
Created April 17, 2012 19:14
store/display an image in mongodb using mongoose/express
/**
* Module dependencies
*/
var express = require('express');
var fs = require('fs');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
// img path
@ktkaushik
ktkaushik / req.sails.json
Created July 23, 2013 10:27
request object in sailsjs
{ domain: null,
_events: { data: [Function], end: [Function] },
_maxListeners: 10,
socket:
{ domain: null,
_events:
{ drain: [Function: ondrain],
timeout: [Object],
error: [Function],
close: [Object] },
@hofmannsven
hofmannsven / README.md
Last active June 17, 2024 10:34
Git CLI Cheatsheet
module.exports = {
get: function (req, res) {
res.sendfile(req.path.substr(1));
},
_config: {
rest: false,
shortcuts: false
}
};
@Chaser324
Chaser324 / GitHub-Forking.md
Last active June 16, 2024 07:13
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@jdx
jdx / boot.js
Last active March 16, 2023 18:08
zero-downtime node.js app runner
// This script will boot app.js with the number of workers
// specified in WORKER_COUNT.
//
// The master will respond to SIGHUP, which will trigger
// restarting all the workers and reloading the app.
var cluster = require('cluster');
var workerCount = process.env.WORKER_COUNT || 2;
// Defines what each worker needs to run
@staltz
staltz / introrx.md
Last active June 21, 2024 12:27
The introduction to Reactive Programming you've been missing
@logan-pugh
logan-pugh / UserController.spec.js
Last active August 29, 2015 14:05
Sails.js testing setup
/**
* Location: /test/controllers/UserController.spec.js
*
* @description :: Tests the UserController
*/
var request = require('supertest'),
appHelper = require('../helpers/appHelper'),
userFixtures = require('../fixtures/users');
@andrealbinop
andrealbinop / setup-modernie-vagrant-boxes.md
Last active May 28, 2023 01:54
Setup modern.ie vagrant boxes

Setup modern.ie vagrant boxes

Since modern.ie released vagrant boxes, it' no longer necessary to manually import the ova file to virtualbox, as mentioned here.

However, the guys at modern.ie didn't configured the box to work with WinRM. This how-to addresses that, presenting steps to proper repackage these boxes, adding WinRM support. Additionally configures chocolatey package manager and puppet provisioner.

Pre-requisites

@chrissimpkins
chrissimpkins / gist:5bf5686bae86b8129bee
Last active June 19, 2024 18:05
Atom Editor Cheat Sheet: macOS

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on macOS.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key