Skip to content

Instantly share code, notes, and snippets.

View strika's full-sized avatar

Nebojša Stričević strika

View GitHub Profile

Code Review Tools

  • Codebeat - $20 per user.
  • Codacy - Free for teams up to 4 users. $15 for teams with more than 4 users.
  • Code Climate - Free for teams up to 4 users. $20 for teams with more than 4 users.
  • CodeFactor - $19 for 5 private repositories and unlimited number of users.
  • Hound - $49 for 4 private repositories and unlimited number of users.
  • Sider - $12 per user.
@strika
strika / debian_installation.md
Last active December 11, 2018 11:31
Debian installation tips

Debian Installation on Macbook Pro

Manual setup for 2 displays

Run xrandr to identify your displays. Calculate virtual buffer. Setup displays with:

xrandr --output HDMI-2 --scale 2x2 --mode 1920x1080 --fb 3840x3760 --pos 0x0
xrandr --output eDP-1 --scale 1x1 --pos 640x2160
@strika
strika / rails_engine_migrations.rb
Created May 7, 2018 08:56
Append migrations from a Rails engine to the main application
initializer :append_migrations do |app|
unless app.root.to_s.match(root.to_s)
config.paths["db/migrate"].expanded.each do |expanded_path|
app.config.paths["db/migrate"] << expanded_path
end
end
end
@strika
strika / how-to-take-nap.md
Created June 29, 2017 11:55
How to take a nap

I nap for 20 minutes every day at work (at my previous company, for 4 years or so and now since I'm working remotely). Here are my steps for taking a nap:

  1. Find a good place to nap. Use the same place every day. I used to nap under my desk on a lazy bag at my last job.

  2. Quickly find a comfortable position. Quickly fix everything that bothers you (like watch on your wrist or anything else that's making you uncomfortable).

  3. Start breathing from your stomach - not your upper torso. Your stomach should raise up and down, not your upper torso.

  4. Relax your whole body. In the beginning, start by relaxing one by one region. First your toes. Then your lower leg, then your upper leg. Then the other leg... Until you relax your whole body. It should feel as your mind is separate from your body. Like it could go out of it. Your body should be completely numb. Later, as you progress, you will be able to relax your whole body with a few breaths. As if some force flows from your stomach and removes spasm from you

@strika
strika / selenium-log.rb
Created March 13, 2017 10:20
Print Firefox log
puts page.driver.browser.manage.logs.get(:browser).map { |m| "#{m.level}: #{m.message}" }.join("\n")
@strika
strika / routing.rb
Created February 16, 2017 09:10
Module for using routes in Services and other "non-rails" classes.
module Routing
extend ActiveSupport::Concern
include Rails.application.routes.url_helpers
include Aligni::HostHelper
included do
def default_url_options
ActionMailer::Base.default_url_options
end
@strika
strika / dropdown-keep-open.js
Created January 24, 2017 10:53
A utility for keeping a Bootstrap drop down menu open after a link is clicked.
// A utility for keeping a Bootstrap drop down menu open after a link is
// clicked
//
// Usage:
//
// <div class="dropdown">
// <a href="" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
// Dropdown trigger <span class="caret"></span>
// </a>
//
@strika
strika / update_design.sh
Created December 3, 2016 08:04
Script for updating design files
#!/bin/bash
bundle exec sass-convert public/_mockups/default.css app/assets/stylesheets/default.scss
sed -i 's/url(..\/img\/\(.*\))/image-url("\1")/g' app/assets/stylesheets/default.scss
sed -i 's/url("..\/img\/\(.*\)")/image-url("\1")/g' app/assets/stylesheets/default.scss
sed -i "s/url('..\/img\/\(.*\)')/image-url(\"\1\")/g" app/assets/stylesheets/default.scss
sed -i "s/url('..\/fonts\/\([a-zA-Z0-9./?#_-]*\)')/font-url('\1')/ig" app/assets/stylesheets/default.scss