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
# Stick this in config/initializers and restart your app to install | |
# Then you can log your deprecations to log/deprecations.log quickly and easily | |
# To log with this, just call: | |
# DeprecationLogger.notify('StringDescriptionOfMethod', DeprecationLogger.caller_method) | |
class DeprecationLogger < Logger | |
@logfile = File.open(Rails.root.join('log','deprecations.log'), 'a') | |
@logfile.sync = 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
# This is in my .profile, you could also put it in your .bash_profile | |
feature_deliver() { | |
CURRENT=`git branch | grep '\*' | awk '{print $2}'` | |
feature_update | |
git checkout master | |
git merge --squash --no-commit ${CURRENT} | |
git commit | |
} | |
feature_update() { |
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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
if [[ -n "$PS1" ]]; then | |
# don't put duplicate lines in the history. See bash(1) for more options | |
# ... or force ignoredups and ignorespace | |
HISTCONTROL=ignoredups:ignorespace |
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
begin | |
require 'ruport' | |
rescue LoadError => err | |
warn "Couldn't load ruport gem: #{err}" | |
end | |
namespace :import do | |
desc 'Import tickets from CSV File' | |
task :csv => :environment do |
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
<?php | |
function calculate ($calories, $fiber, $fat) { | |
$points_from_fat = $fat / 12; | |
if ($fiber = 0) { | |
$fiber_caloric_reduction = 0; | |
} elseif ($fiber < 4) { | |
$fiber_caloric_reduction = $fiber * 10; | |
} elseif ($fiber > 4) { | |
$fiber_caloric_reduction = 40; |
NewerOlder