This is a maintained listing of all the different ways to debug and profile Node.js applications. If there is something missing or an improvement, post a comment! :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SVG path string | |
path_string = "M,208,405C,208,405,206,744,206,744C,206,744,552,715,552,715C,552,715,590,451,590,451C,590,451,208,405,208,405" | |
# points will contain an array of arrays for each point of the path | |
points = Raphael.parsePathString(pe.attrs.path_string) | |
spline = new THREE.Shape() | |
spline.autoClose = true | |
_.each points, (p, i) -> | |
switch p[0] |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OSX for Hackers (Mavericks/Yosemite) | |
# | |
# Source: https://gist.github.com/brandonb927/3195465 | |
#!/bin/sh | |
# Some things taken from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Ask for the administrator password upfront |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpack = require('webpack'); | |
var path = require('path'); | |
var node_modules_dir = __dirname + '/node_modules'; | |
var node_env = process.env.NODE_ENV; | |
var config = { | |
addVendor: function(name, path) { | |
this.resolve.alias[name] = path; | |
}, | |
addPlugin: function(plugin) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DatePickerInput < SimpleForm::Inputs::StringInput | |
def display_pattern | |
I18n.t('datepicker.dformat', default: '%d/%m/%Y') | |
end | |
def picker_pattern | |
I18n.t('datepicker.pformat', default: 'dd/MM/yyyy') | |
end | |
def wrapper_classes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.directive 'slickCarousel', -> | |
restrict: "A" | |
link: (scope, element, attrs, ctrl) -> | |
scope.responsive = | |
breakpoint: 1024 | |
settings: | |
slidesToShow: 3 | |
slidesToScroll: 3 | |
infinite: true | |
dots: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2015-11-10T10:32:06.667094+00:00 app[worker.1]: 3 TID-owedgntl8 INFO: Booting Sidekiq 3.4.2 with redis options {:url=>"redis://h:[email protected]:10079", :network_timeout=>5} | |
2015-11-10T10:32:07.827346+00:00 app[worker.1]: FATAL: sorry, too many clients already | |
2015-11-10T10:32:07.827358+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:655:in `initialize' | |
2015-11-10T10:32:07.827366+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:655:in `new' | |
2015-11-10T10:32:07.827367+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize' | |
2015-11-10T10:32:07.827368+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new' | |
2015- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Open your terminal, navigate to the folder were the book.csv file is residing | |
# and type irb, when the interactive ruby console launches, type in the following | |
# it will print first 5 ISBN-13 numbers | |
require 'csv' | |
i = 0; CSV.foreach('book.csv', headers: :first_row, encoding: 'UTF-16LE:UTF-8') { |line| break if i == 5; puts line['isbn13']; i += 1 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table mydata_real (id serial, date date, value text); | |
create table mydata_real_y2015 (check (date >= '2015-01-01' and date < '2016-01-01')) inherits (mydata_real); | |
create table mydata_real_y2016 (check (date >= '2016-01-01' and date < '2017-01-01')) inherits (mydata_real); | |
create function mydata_nope() returns trigger language plpgsql | |
as $f$ begin raise exception 'insert on wrong table'; return NULL; end; $f$; | |
create trigger mydata_nope before insert on mydata_real execute procedure mydata_nope(); | |
create view mydata as select * from mydata_real; |