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
In config/initializers/devise.rb configure your custom failure app: | |
config.warden do |manager| | |
manager.failure_app = CustomFailureApp | |
end | |
And in lib/custom_failure_app.rb: | |
class CustomFailureApp < Devise::FailureApp | |
def redirect | |
message = warden.message || warden_options[:message] |
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
public enum CustomerGroupConditionStrategy implements ConditionStrategy { | |
INSTANCE; |
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 log --shortstat --author "Karen Baker" --since "2 weeks ago" | grep "files\? changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print "files changed", files, "lines inserted:", inserted, "lines deleted:", deleted}' |
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
#!/usr/bin/env bash | |
git checkout master | |
git pull | |
git branch -d $1 |
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
/* Create an array with the values of all the checkboxes in a column */ | |
$.fn.dataTableExt.afnSortData['dom-checkbox'] = function ( oSettings, iColumn ) | |
{ | |
return $.map( oSettings.oApi._fnGetTrNodes(oSettings), function (tr, i) { | |
return $('td:eq('+iColumn+') input', tr).prop('checked') ? '1' : '0'; | |
} ); | |
} | |
$('.ratemgr-table').dataTable({ |
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 branch --merged master | grep -v master | xargs git branch -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
git branch -r --merged | grep -v master | sed 's/origin\///' | xargs -n 1 git push --delete origin |
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
SELECT c.ID, c.user_id | |
FROM carriers c | |
LEFT JOIN users u ON c.user_id = u.ID | |
WHERE u.ID IS NULL |
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
SELECT id, COUNT( * ) , MAX( ID ) AS dupes | |
FROM method_codes | |
GROUP BY code | |
HAVING ( | |
COUNT( * ) >1 | |
) | |
LIMIT 0 , 30 |
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 clean -d -fx "" |