Skip to content

Instantly share code, notes, and snippets.

View sergii's full-sized avatar

Serhii Ponomarov sergii

View GitHub Profile
@sergii
sergii / chmod_commands
Last active August 29, 2015 14:13
chmod on folder
Apply chmod commands to folder:
sudo chmod -R 777 /path/to/directory
OR
sudo find /home/s/ooma/sp_030315/ -type f -exec chmod 777 {} \; # FOR FILES
sudo find /home/s/ooma/sp_030315/ -type d -exec chmod 777 {} \; # FOR DIRECTORIES
@sergii
sergii / httpie.sh
Last active August 29, 2015 14:13 — forked from chris-rock/httpie.sh
apt-get update && apt-get install -y curl && curl --silent https://bootstrap.pypa.io/get-pip.py |python3 && pip install --upgrade httpie
@sergii
sergii / $
Created January 26, 2015 11:17
Найти первый коммит в котором поломались тесты
$ git bisect run rspec - найти первый коммит в котором поломались тесты
@sergii
sergii / unicorn.sh
Last active August 29, 2015 14:14 — forked from troex/unicorn.sh
#!/bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs mysql
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: unicorn initscript
# Description: Unicorn is an HTTP server for Rack application
### END INIT INFO
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
@sergii
sergii / gist:ca028a3ffa508b5fba4b
Created February 19, 2015 13:19
How to Search for Files Recursively into Subdirectories
sudo find . -print | grep -i '.*[.]xml'
@sergii
sergii / gist:6649d22f60f15ab87417
Created April 21, 2015 16:12
Recognize version of RabbitMQ server
$ dpkg -s rabbitmq-server | grep Version
((http?|https?):\/\/)?(www.)?behance.net([\/\w \.-]*)*\/?
@sergii
sergii / _form.html.erb
Created September 27, 2015 18:21 — forked from vjm/_form.html.erb
CRUD Devise Example
<%= form_for(@user) do |f| %>
<% if @user.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
<ul>
<% @user.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
@sergii
sergii / gist:13c255a61461b1361656
Created February 5, 2016 14:03 — forked from alex-zige/gist:5795358
Rails Rspec API Testing Notes

Rails Rspec APIs Testing Notes

Folders Structure

  spec
  |--- apis #do not put into controllers folder. 
        |--- your_api_test_spec.rb  
  |--- controllers
  |--- models
  |--- factories
 |--- views