This file contains hidden or 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
# patch array for pairwise function | |
class Array | |
def pairwise | |
pairs = [] | |
a = self.slice(1..-1).each_slice(2).to_a | |
self.each_slice(2).to_a.each_with_index do |el, idx| | |
pairs << el if el.size > 1 | |
pairs << a[idx] if a[idx] && a[idx].size > 1 | |
end | |
pairs.each do |pair| |
This file contains hidden or 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
find app/* | xargs pcregrep --color='auto' -n "[\x80-\xFF]" |
This file contains hidden or 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
<pre id="n1" class="prettyprint"> | |
some code | |
</pre> | |
<button class="clip_button" data-clipboard-ref="#n1"><b>Copy To Clipboard</b></button> | |
<pre id="n2" class="prettyprint"> | |
some other code | |
</pre> | |
<button class="clip_button" data-clipboard-ref="#n1"><b>Copy To Clipboard</b></button> |
This file contains hidden or 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 | |
for branch in $(git branch -a | grep "remotes/origin/" | grep -v "master" | sed 's|remotes/||') | |
do | |
echo "checking $branch for unmerged changes" | |
if git diff --exit-code master...$branch > /dev/null | |
then | |
echo "no commits found which were not already merged into master" | |
echo "should i delete the branch $branch?(y/n): " | |
read answer | |
if [ $answer = "y" ] |
This file contains hidden or 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 -1 | grep "commit .*" | ruby -e "print ARGF.read.split(' ')[1]" | pbcopy |
This file contains hidden or 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
# add this line to the Gemfile | |
gem "gelf", :git => 'git://github.com/galaxycats/gelf-rb.git' # as long as our changes are not merged | |
# add this lines to your config | |
config.logger = GELF::RailsLogger.new("<host>", 12201, "WAN", { :facility => "<app-name>" }) | |
config.logger.level = Logger::INFO | |
# deactivate colorizing of the log-messages | |
config.active_record.colorize_logging = false |