Skip to content

Instantly share code, notes, and snippets.

@getvega
getvega / MazTheme.tmTheme
Created June 27, 2016 12:42
Custom Sublime Theme : derived from JavascriptNext theme, supporting MaterialTheme ST plugin
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Generated by: TmTheme-Editor -->
<!-- ============================================ -->
<!-- app: http://tmtheme-editor.herokuapp.com -->
<!-- code: https://github.com/aziz/tmTheme-Editor -->
<plist version="1.0">
<dict>
<key>name</key>
<string>Next</string>
PATH=/usr/sbin:/sbin:/usr/local/share/npm/bin:/usr/local/bin:$PATH
####################################
# GENERAL ALIASES
####################################
alias ngrestart='sudo nginx -s stop && sudo nginx'
alias topten='du -sk $(/bin/ls -A) | sort -rn | head -10'
alias cgrep='grep -G'
alias ls='ls -G'
// Using library https://github.com/justinwalsh/linkedin-js
this.api.apiCall('POST', '/people/~/following/companies',
{
oauth_token_secret: this.socialAccount.token_secret,
oauth_token: this.socialAccount.token
},
{
id: account.id
},
callback
@getvega
getvega / winston-stacktrace.js
Last active February 9, 2018 05:39
override winston.logger.log to add stacktrace along errors included
var logger = require('winston');
// override winston.logger.log to add stacktrace along errors included
// 4 ways to include some errors in a log:
// - logger.warn('message', myError)
// - logger.warn('message', [myError1, myError2])
// - logger.warn('message', { error: myError })
// - logger.warn('message', { errors: [myError1, myError2] })
(function(logger) {
var _log = logger.log;

Logging in NodeJS

  • on the app side winston: "a multi-transport async logging library for node.js" -- logs on the console, file, and event custom endpoints

  • Saas log receivers

  • SplunkStorm that one looks good