Skip to content

Instantly share code, notes, and snippets.

View bosskovic's full-sized avatar

Marko Bošković bosskovic

  • Jomb AG
  • Novi Sad, Serbia
View GitHub Profile
# features/step_definitions/api_steps.rb
# These steps are very deeply inspired in the Anthony Eden (@aeden) API steps.
# See http://vimeo.com/30586709
# Given
Given /^I send and accept JSON$/ do
header 'Accept', 'application/json'
# https://github.com/jayzes/cucumber-api-steps
# https://gist.github.com/gonzalo-bulnes/7069339
# http://anthonyeden.com/2013/07/10/testing-rest-apis-with-cucumber-and-rack.html
# http://vimeo.com/30586709
Given /^I send and accept HTML$/ do
header 'Accept', "text/html"
header 'Content-Type', "application/x-www-form-urlencoded"
end
@bosskovic
bosskovic / adding_repositories.sh
Last active August 29, 2015 14:05
After installing Ubuntu 14.04
sudo add-apt-repository -y ppa:videolan/stable-daily
sudo add-apt-repository -y ppa:otto-kesselgulasch/gimp
sudo add-apt-repository -y ppa:gnome3-team/gnome3
sudo add-apt-repository -y ppa:webupd8team/java
sudo add-apt-repository -y ppa:webupd8team/y-ppa-manager
sudo add-apt-repository -y ppa:atareao/atareao
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
=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')
@bosskovic
bosskovic / Capfile
Last active August 29, 2015 14:10
capistrano setup
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rvm'
require 'capistrano/bundler'
require 'capistrano/rails/migrations'
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
Dir.glob('lib/capistrano/**/*.rb').each { |r| import r }
# Initialize repository:
git init
# Get current status:
git status
# Add file myfile.txt:
git add myfile.txt
# Commit with a message:
@bosskovic
bosskovic / common_commands.sh
Created November 24, 2014 19:56
nginx notes
sudo service nginx start
sudo service nginx stop
sudo service nginx restart
# show configuration errors
nginx -c /etc/nginx/nginx.conf -t
@bosskovic
bosskovic / lingoChecks_examples
Last active December 14, 2015 20:19
Some examples of lingoChecks syntax in the resource files
lh-check {min: 2, max:-3, placeholders:false, terms: lingohub}
lh-check {terms:[lingohub, Github]}
lh-check { min: %60 }
lh-check {placeholders:true, terms: [lingohub, Github], min: +5, max:110%}
# located in the navbar
# lh-check { max: 25, placeholders: true }
# should not be wrapped
hello_user = Hello {username}
# located on the landing page
# lh-check { min: 90%, max: 110%, terms: [iOS, Android] }
localize_bullet = Localize your product on iOS, Android or any other major platform. We support all files and formats, streamlined and hassle-free.
# this description and the following lingCheck belong to the commented out translation, so both will be ignored on import
@bosskovic
bosskovic / example.yml
Last active December 15, 2015 23:59
YAML resource file example
# this comment is ignored because it is not directly followed by a key-value pair
en:
# this comment is also ignored,
# because it is followed by a key that has children nodes
header:
hello_user : Hello %{username}
# comments are treated as translation descriptions
# belonging to the key-value pair that follows
# lingochecks as well