This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git stash # Stash changes if any | |
git symbolic-ref HEAD refs/heads/${NEW_BRANCH} # Change head to a new, non-existing ref | |
git rm -rf . # Delete files from version control and working directory | |
rm -r . # Delete files from file system | |
git commit --allow-empty -m "Created new branch ${NEW_BRANCH}" # Commit changes in the new branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: supervisord | |
# Required-Start: $remote_fs | |
# Required-Stop: $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Example initscript | |
# Description: This file should be used to construct scripts to be | |
# placed in /etc/init.d. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fakeweb' | |
require 'fake_resource' | |
ActiveResource::Base.send :include, ActiveResource::FakeResource | |
Before do | |
FakeWeb.allow_net_connect = false | |
end | |
After do |scenario| | |
ActiveResource::FakeResource.clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: supervisord | |
# Required-Start: $remote_fs | |
# Required-Stop: $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Example initscript | |
# Description: This file should be used to construct scripts to be | |
# placed in /etc/init.d. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# supervisord This scripts turns supervisord on | |
# | |
# Author: Mike McGrath <mmcgrath@redhat.com> (based off yumupdatesd) | |
# | |
# chkconfig: - 95 04 | |
# | |
# description: supervisor is a process control utility. It has a web based | |
# xmlrpc interface as well as a few other nifty features. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CucumberExternalResqueWorker | |
DEFAULT_STARTUP_TIMEOUT = 1.minute | |
COUNTER_KEY = "cucumber:counter" | |
class << self | |
attr_accessor :pid, :startup_timeout | |
def start | |
# Call from a Cucumber support file so it is run on startup | |
return unless Rails.env.cucumber? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# == IGNORE LOCAL CHANGES | |
# ignore local changes to repository files or directories | |
git update-index --assume-unchanged path/to/file/or/directory | |
# -- ALIAS | |
# or you can alias it in your ~/.gitconfig | |
[alias] | |
au = update-index --assume-unchanged | |
# == UN-IGNORE LOCAL CHANGES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error_reporting(E_ALL); | |
ini_set('display_errors', TRUE); | |
ini_set('display_startup_errors', TRUE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/models/ability.rb | |
# All front end users are authorized using this class | |
class Ability | |
include CanCan::Ability | |
def initialize(user) | |
user ||= User.new | |
can :read, :all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'axlsx' | |
p = Axlsx::Package.new | |
p.workbook do |wb| | |
# define your regular styles | |
styles = wb.styles | |
title = styles.add_style :sz => 15, :b => true, :u => true | |
default = styles.add_style :border => Axlsx::STYLE_THIN_BORDER | |
header = styles.add_style :bg_color => '00', :fg_color => 'FF', :b => true | |
money = styles.add_style :format_code => '#,###,##0', :border => Axlsx::STYLE_THIN_BORDER | |
percent = styles.add_style :num_fmt => Axlsx::NUM_FMT_PERCENT, :border => Axlsx::STYLE_THIN_BORDER |
OlderNewer