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
shime /
Created Nov 19, 2014
text from kata at solution is in 3 lines of code.

We want to create a function that will add numbers together when called in succession.

add(1)(2) == 3 // true

We also want to be able to continue to add numbers to our chain.

add(1)(2)(3) == 6 // true
shime / rc.xml
Created Nov 6, 2014
openbox shortcuts for window management
View rc.xml
<!-- resize windows with Alt + Direction -->
<keybind key="A-Right">
<action name="GrowToEdgeEast"/>
<keybind key="A-Left">
<action name="GrowToEdgeWest"/>
<keybind key="A-Down">
<action name="GrowToEdgeSouth"/>
shime / ngnix.conf
Created Oct 31, 2014
redirect non-www to www with or without ssl in ngnix
View ngnix.conf
# ->
# ->
server {
listen 80;
return 301$request_uri;
# ->
server {
shime / list_files.js
Created Oct 9, 2014
list files in a directory with node.js
View list_files.js
var fs = require('fs'),
path = require('path')
var listFiles = function(dir, next){
fs.readdir(dir, function(err, nodes){
if (err) next(err)
next(null, nodes.filter(function(node){
return fs.lstatSync(path.resolve(dir) + "/" + node).isFile()
shime /
Created Sep 30, 2014
run the minitest test suite without rake

To run bunch of Minitest tests in one go, without using Rake, use this command

$ ruby -e 'ARGV.each { |path| require "./#{path}" }' test/*.rb
shime /
Last active Jan 9, 2020
github oauth in node using express


Most basic example of authenticating with Github in node.


Clone this gist, change keys inside config.js and then hit npm install && node app.js.


shime /
Last active Apr 22, 2019
comparing dates and times in RSpec

What is this?

How do you compare date/times in RSpec?

If you do this

expect( eq, 4, 2).to_i
shime /
Created Jan 16, 2014
testing Ember.RSVP with QUnit
test "the Ember.RSVP.Promise works", ->
promise = new Ember.RSVP.Promise((resolve, reject) ->, resolve, "value")
) =>
promise.then (actual) ->
equal(actual, 'value', 'promise resolved with "hello"')
shime /
Created Nov 28, 2013
easier renaming and moving of files in vim

Simple function that makes moving and renaming files in Vim much easier.


Place it in your ~/.vimrc.

I'm calling it with <leader>N here, map it to anything you like.

shime / artists.json
Created Nov 2, 2013
some good electroswing artists
View artists.json
"artists": [
"parov stelar",
"tape five",
You can’t perform that action at this time.