Skip to content

Instantly share code, notes, and snippets.

Hrvoje Šimić shime

Block or report user

Report or block shime

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View app.js
var express = require('express')
, app = express()
, http = require('http')
, server = http.createServer(app)
, io = require('').listen(server);
app.get('/', function(request, response){
response.sendfile(__dirname + "/index.html");
shime / .gitignore
Last active Dec 24, 2015 — forked from uu59/.gitignore and sinatra in action
View .gitignore
shime /
Last active Nov 16, 2017
bake your own code reloader for rails

Let's build our own code reloader for Rails, shall we?

Require dependency problems

Run this inside rails/railties:

$ grep -rn "eager_load_paths" .

You should get the results from Rails::Engine::Configuration and Rails::Engine. As you know, each Rails application is actually a Rails::Engine and Rails::Engine::Configuration is that thing wrapped inside Rails.application.config block.

shime / _app.rb
Last active Dec 23, 2015
DCI implementation of OAuth with Github in Sinatra
View _app.rb
require "sinatra"
get "/oauth/github" do
get "/oauth/github/callback" do
shime /
Created Sep 15, 2013
order of stubs and factory girl
  1. stub
  3. FactoryGirl.build_stubbed
  4. FactoryGirl.create

Always choose the upper one if you can.

shime /
Created Sep 10, 2013
stop clearing screen when suspending from vim

I've been watching a lot of Gary Bernhardt's videos lately. I like how he constantly switches from Vim to terminal simply by using <C-z> to suspend Vim and $ fg to bring it back to the foreground.

The behavior of my local Vim was quite different, though. My screen was cleared every time I exit Vim. It was annoying. It was painful. I've finally stumbled upon solution:

" place this in your ~/.vimrc

set t_ti= t_te=
shime /
Created Sep 2, 2013
bash keyboard shortcuts

Bash keyboard shortcuts


  • move back one character: Ctrl + b
  • move forward one character: Ctrl + f
  • delete current character: Ctrl + d
  • delete previous character: backspace
shime /
Last active Oct 24, 2016
describes redirection issue from

Run it with:

curl -fsSL | bash -e
shime /
Last active Dec 19, 2015
replicate a Gemrat issue described by @dru in

Run it with:

$ curl -fsSL | bash -e
shime /
Last active Oct 2, 2019
getting tired of guessing tar flags in 2013?

Looks familiar?

Worry no more! Use extract and prosper!


You can’t perform that action at this time.