Skip to content

Instantly share code, notes, and snippets.

View Szeliga's full-sized avatar

Szymon Szeliga Szeliga

View GitHub Profile
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:REDACTED@ec2-54-217-238-169.eu-west-1.compute.amazonaws.com: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-
app.directive 'slickCarousel', ->
restrict: "A"
link: (scope, element, attrs, ctrl) ->
scope.responsive =
breakpoint: 1024
settings:
slidesToShow: 3
slidesToScroll: 3
infinite: true
dots: true
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
@Szeliga
Szeliga / gist:3d4ce2925c89a7fbcc59
Created February 25, 2015 12:24
Webpack config
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) {
# 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

Description

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

Results

Debugging & Profiling Node.js

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! :)

Interactive Stack Traces with traceGL - Shareware

  1. Guide here
# 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]
@Szeliga
Szeliga / .gitignore
Created October 21, 2012 16:56 — forked from bergie/.gitignore
Node.js email handling examples
config.json
reading-image.png
def touch
@user.touch
render :json => {"status" => "touched"}
end