Skip to content

Instantly share code, notes, and snippets.

View mohitsethi's full-sized avatar
🎯
Focusing

Mohit Sethi mohitsethi

🎯
Focusing
View GitHub Profile
@mohitsethi
mohitsethi / github.css
Created November 12, 2015 07:31 — forked from theconektd/github.css
Github Markdown CSS - for Markdown Editor Preview
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
---
driver:
name: vagrant
provisioner:
name: chef_zero
platforms:
- name: centos-6.4
- name: ubuntu-12.04
require 'spec_helper'
describe 'apache::default' do
let(:chef_run) {
ChefSpec::SoloRunner.new do |node|
# node.automatic['ipaddress'] = '10.10.10.10'
end.converge(described_recipe)
}
it 'install package apache2' do
require 'spec_helper'
describe 'cookbook_name::recipe_name' do
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
it 'does something' do
expect(chef_run).to action_resource_type('NAME OF THE RESOURCE')
end
end
@mohitsethi
mohitsethi / gist:5d39f751df93fe6e3c3e
Created October 7, 2015 10:20
Rake task for Chefspec
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:chefspec)
@mohitsethi
mohitsethi / gist:2dc1091cb0c5bacfdcc9
Created October 7, 2015 10:19
Rake Task for Rubocop
require 'rubocop/rake_task'
RuboCop::RakeTask.new
#!/usr/bin/env ruby
# -*- mode: ruby -*-
# vi: set ft=ruby :
dir_pwd = Dir.pwd
dir_chef_repo = dir_pwd
dir_chef = "#{dir_chef_repo}/.chef"
# dir_cookbooks = "#{dir_pwd}/cookbooks"
dir_cookbooks = "#{dir_pwd}/cookbooks"
dir_roles = "#{dir_pwd}/roles"
dir_nodes = "#{dir_pwd}/nodes"
@mohitsethi
mohitsethi / gist:8b7a72e96d027e026c2f
Created September 13, 2015 07:43
chefspec-Rake task
# chefspec task against spec/*_spec.rb
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:chefspec)
#
# Cookbook Name:: apache2
# Recipe:: default
#
# Copyright (c) 2015 The Authors, All Rights Reserved.
execute "update apt cache" do
command "sudo apt-get update -y"
end
@mohitsethi
mohitsethi / README.md
Last active September 2, 2015 07:28 — forked from mbbx6spp/README.md
Gerrit vs Github for code review and codebase management

Gerrit vs Github: for code review and codebase management

Sure, Github wins on the UI. Hands down. But, despite my initial annoyance with Gerrit when I first started using it almost a year ago, I am now a convert. Fully. Let me tell you why.

Note: This is an opinionated (on purpose) piece. I assume your preferences are like mine on certain ideas, such as:

  • Fast-forward submits to the target branch are better than allowing merge commits to the target branch. The reason I personally prefer this is that, even if a non-conflicting merge to the target branch is possible, the fact that the review/pull request is not up to date with the latest on the target branch means feature branch test suite runs in the CI pipeline reporting on the review/PR may not be accurate. Another minor point is that forced merge commits are annoying as fuck (opinion) and clutter up Git log histories unnecessarily and I prefer clean histories.
  • Atomic/related changes all in one commit is something worth striving for. Having your dev