Skip to content

Instantly share code, notes, and snippets.

View sgress454's full-sized avatar

Scott Gress sgress454

View GitHub Profile
@sgress454
sgress454 / iterm_smart_select_for_node_stack_traces.txt
Created March 4, 2014 01:49
iTerm smart select to open Node stack traces in Sublime
To set up iTerm 2 so you can open files referenced in a Node stack trace directly in Sublime:
1. Go to Preferences->Advanced
2. Under "Smart Selection", click the "EDIT" button
3. Click the + to add a new rule
4. For the Regular expression, user ^\s*at.*\((.+)\)
5. For priority, choose Very High
6. Click "Edit Actions"
7. Click the + to add a new action
8. Title "Open in Sublime"
@sgress454
sgress454 / sails_reload.js
Created September 19, 2014 20:25
Reload a Sails API at runtime
// Reload controller middleware
sails.hooks.controllers.loadAndRegisterControllers(function() {
sails.once('hook:orm:reloaded', function() {
// Flush router
sails.router.flush();
// Reload blueprints
sails.hooks.blueprints.bindShadowRoutes();
@sgress454
sgress454 / designer.html
Last active August 29, 2015 14:13
designer
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../paper-button/paper-button.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@sgress454
sgress454 / sails_rc5_dependencies.txt
Created December 28, 2015 17:13
Notes on upgrades from v0.11.3 dependencies to now
Following is the list of top-level non-development dependencies with their versions in v0.11.x and notes detailing the version they are upgraded to in v0.12.x (if any) and why. New dependencies (like `consolidate`) have notes explaining the choice of current version.
├── anchor@~0.10.5 (ours)
├── async@0.9.2 -> 0.10.5 (has changelog, lots of bug fixes and good stuff)
├── captains-log@~0.11.11 (ours)
├── colors@0.6.2 -> 1.1.2 (no changelog, but seems to be just bugfixes and it's only used for logs)
├── commander@2.1.0 -> 2.9.0 (has changelog, bugfixes et al)
├── connect@2.25.0 -> 2.29.1 (required by our express version)
├── connect-flash@0.1.1 (latest)
├── consolidate@0.12.1 (latest is just react/promises stuff)
npm ls --depth=1
rest-api@0.2.0 /www/5m/rest-api
├── bluebird@3.1.5
├─┬ chai@3.5.0
│ ├── assertion-error@1.0.1
│ ├── deep-eql@0.1.3
│ └── type-detect@1.0.0
├─┬ debug@2.2.0
│ └── ms@0.7.1
├── bcrypt@0.8.5 extraneous
├── bcryptjs@2.3.0
├─┬ connect-redis@1.4.5
│ ├─┬ debug@2.2.0
│ │ └── ms@0.7.1
│ └── redis@0.7.3
├── ejs@0.8.8 -> /home/ubuntu/.nvm/versions/node/v4.2.1/lib/node_modules/sails/node_modules/ejs
├── forever@0.15.1 extraneous
├─┬ grunt@0.4.2 -> /home/ubuntu/.nvm/versions/node/v4.2.1/lib/node_modules/sails/node_modules/grunt
@sgress454
sgress454 / sails_issue_repo_instructions.md
Last active February 24, 2016 11:58
How to make a repo for reproducing a Sails issue

The instructions below will work with the regular Git command-line tool or the hub CLI tool (makes things a bit faster).

# Make a new Sails app with a descriptive title
sails new sails-issue-cant-use-handlebars-layout
cd sails-issue-cant-use-handlebars-layout

# Install the minimum node modules needed to reproduce the issue, making careful note of versions
# and remembering to use --save and --save-exact
npm install handlebars@4.0.5 --save --save-exact
@sgress454
sgress454 / waterline_issue_repo_instructions.md
Created March 2, 2016 18:27
How to make a repo for reproducing a Waterline issue

The instructions below will work with the regular Git command-line tool or the hub CLI tool (makes things a bit faster).

# Make a new Sails app with a descriptive title
sails new waterline-issue-cant-create-records
cd waterline-issue-cant-create-records

# Install the minimum node modules needed to reproduce the issue, making careful note of versions
# and remembering to use --save
npm install sails-mysql --save
@sgress454
sgress454 / algorithm-for-orderiner g-routes.md
Last active October 20, 2016 16:39
Algorithm for ordering routes

An algorithm for ordering routes

Definition of a "route"

For the purposes of this algorithm, a route is a string containing:

  • An optional HTTP verb (or ALL) prefix, followed by a space, followed by:
  • 1 or more path components, where each path component is:
    • A forward slash /, followed by:
  • A colon : followed by any combination of letters and numbers (a "param"), OR
@sgress454
sgress454 / sails-1.0-removed-deps.md
Created December 2, 2016 00:28
Dependencies removed in Sails 1.0

Dependencies removed in Sails v1.0

Dependency Version
anchor ~0.10.5
connect-flash 0.1.1
ejs-locals 1.0.2
express-handlebars 3.0.0
grunt 1.0.1
grunt-cli 1.2.0