Skip to content

Instantly share code, notes, and snippets.

View dalibor's full-sized avatar

Dalibor Nasevic dalibor

View GitHub Profile
@dalibor
dalibor / gist:b8fad6ccc9e156488ea1
Last active December 30, 2020 01:08 — forked from trcarden/gist:3295935
SSL with thin
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key

Writing Commit Messages

One line summary (< 50c)

Longer description (wrap at 72c)

Summary

@dalibor
dalibor / gist:5077516
Last active December 14, 2015 11:09 — forked from bkimble/gist:1365005
List local memcached keys using Ruby
#!/usr/bin/env ruby
require 'net/telnet'
cache_dump_limit = 100
localhost = Net::Telnet::new("Host" => "localhost", "Port" => 11211, "Timeout" => 3)
slab_ids = []
localhost.cmd("String" => "stats items", "Match" => /^END/) do |c|
matches = c.scan(/STAT items:(\d+):/)
slab_ids = matches.flatten.uniq
end

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@dalibor
dalibor / .rspec
Created December 29, 2012 22:34 — forked from coreyhaines/.rspec
--colour
-I app
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@dalibor
dalibor / CNAME
Created October 22, 2012 19:27 — forked from vladan/CNAME
JS пликација за пресметување на плати. Во контролерот се вршат пресметките, другото е само приказ. angular.min.js е ставен за да работи сѐ од 1ва.
kalkulator.ot.mk
@dalibor
dalibor / es.sh
Created September 4, 2012 00:06
Install ElasticSearch on Ubuntu 12.04
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.0.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
sudo mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
@dalibor
dalibor / rspec_cucumber_learning.markdown
Created August 22, 2012 07:46 — forked from nebojsaz/rspec_cucumber_learning.markdown
Rspec + Cucumber how to on Codebreaker example

Behavior Driven Development

Description of BDD

  • Domain-driven design

Principles of BDD

  • Enough is enough
@dalibor
dalibor / 01-vagrant.sh
Created August 5, 2012 08:10 — forked from hakanensari/01-vagrant.sh
Set up an Ubuntu 12.04 Precise box with Vagrant for Ruby and NodeJS development
gem install vagrant
vagrant box add precise64 http://files.vagrantup.com/precise64.box
vagrant init
vagrant up