Skip to content

Instantly share code, notes, and snippets.

View timurvafin's full-sized avatar

Timur Vafin timurvafin

View GitHub Profile
@timurvafin
timurvafin / Стандарт кодирования Ruby.rdoc
Created October 11, 2010 11:13
Стандарт кодирования Ruby в Flatsoft/Flatsourcing

Структура программы

  • require выражения

  • include выражения

  • определение классов и модулей

  • основная часть программы

  • код для тестирования

Исключения

@timurvafin
timurvafin / Gemfile
Created January 12, 2012 01:32
Integration tests with rspec, capybara and selenium
source :rubygems
gem 'rspec'
gem 'capybara'
gem 'json'
@timurvafin
timurvafin / Gemfile
Created January 13, 2012 12:38
List github repos without commits more then 1 year
source 'http://rubygems.org'
gem 'i18n'
gem 'activesupport', '>= 2.3.5'
gem 'octokit', '~> 0.6.0'
Feature: Sign up
Scenario: Successful sign up
Given I have chosen to sign up
When I sign up with valid details
Then I should receive a confirmation email
And I should see a personalized greeting message
Scenario: Duplicate email
Given I have chosen to sign up
#!/usr/bin/env ruby
PASSWORD = "123456"
USERNAME = "user%d"
(1..3).each do |i|
user = USERNAME % i
puts `/usr/sbin/useradd --groups rvm #{user}`
puts `echo -e "#{PASSWORD}\n#{PASSWORD}" | (/usr/bin/passwd --stdin #{user})`
@timurvafin
timurvafin / copy.rb
Created July 24, 2013 15:46
Copy members from one Github team to other
#!/usr/bin/env ruby
# copy members from one team to other
require 'json'
source_team_id =
target_team_id =
token = ''
@timurvafin
timurvafin / junior-dev-trail-map.md
Last active August 29, 2015 14:03
Junior dev trails map
//
// InAppManager.swift
//
// Created by Ellina Kuznetcova on 12/10/2016.
// Copyright © 2016 Flatstack. All rights reserved.
//
import Foundation
import StoreKit
@sparkcodeuk
sparkcodeuk / floating-ip-gateway.sh
Created March 2, 2018 21:47
Digital Ocean floating IP gateway script (force droplet to use the assigned floating IP for outbound traffic as well as inbound traffic)
#!/bin/bash
# Force outbound traffic through the attached floating IP
NET_INT="eth0"
CURL_TIMEOUT=3
echo -n "Setting floating IP as the default gateway: "
# Check there's a floating IP attached to this droplet
if [ "$(curl -s --connect-timeout $CURL_TIMEOUT http://169.254.169.254/metadata/v1/floating_ip/ipv4/active)" != "true" ]; then