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
< if content =~ /([^-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]%)/ then | |
< CGI.unescape(content).gsub(/(<!\[CDATA\[|\]\]>)/,'').strip | |
< else | |
< content.gsub(/(<!\[CDATA\[|\]\]>)/,'').strip | |
< end | |
--- | |
> if content.respond_to?(:force_encoding) && content.force_encoding("binary") =~ /([^-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]%)/n then | |
> CGI.unescape(content).gsub(/(<!\[CDATA\[|\]\]>)/,'').strip | |
> else | |
> content.gsub(/(<!\[CDATA\[|\]\]>)/,'').strip |
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
# I want to write a method that returns the first number in a sub array where the letter matches a passed in letter | |
# If passed in letter does not exist, it should return nil | |
a = [["a", 1], ["b", 2]] | |
>> #Desired Results | |
>> get_number_for_letter(a, "a") | |
1 | |
>> get_number_for_letter(a, "b") | |
2 | |
>> get_number_for_letter(a, "c") |
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
"People make it out to seem like women are intentionally oppressed. It reminds me of the time when chess went through the same thing. | |
There aren't many female grandmasters! Make them play! | |
I would like for people to go around asking men and women do they want to program. Don't be shocked if the results mirror the current ratio between men and women." |
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
export GIT_PS1_SHOWDIRTYSTATE=true # '*' for unstaged changes, '+' for staged | |
export GIT_PS1_SHOWSTASHSTATE=true # '$' if smth is stashed | |
export GIT_PS1_SHOWUNTRACKEDFILES=true # '%' if un-tracked files | |
# GIT | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
function proml { |
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
# | |
# bash completion support for core Git. | |
# | |
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org> | |
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). | |
# Distributed under the GNU General Public License, version 2.0. | |
# | |
# The contained completion routines provide support for completing: | |
# | |
# *) local and remote branch names |