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
| def remove_doubled_empty_lines(s) | |
| s.squeeze("\r\n").gsub(/(\r\n)+/, "\r\n") | |
| end |
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
| grep -v "^$" inputfile |
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
| # general solution for finding the longest palindrome in a string, | |
| # which runs in O(n) time. | |
| # converted from the Python code here: http://www.akalin.cx/longest-palindrome-linear-time | |
| def find_longest_palindrome(string) | |
| l = [] ; i=0 ; pal_len=0 | |
| while i<string.length | |
| if i > pal_len and string[i-pal_len-1] == string[i] | |
| pal_len += 2 ; i += 1 | |
| next | |
| end |
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
| for f in *.xml; do grep "<in1>" $f | cut -d">" -f2- | cut -d"<" -f1 | base64 -d | iconv -f UTF-16LE -t UTF-8 > decoded-$f ; done |
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
| require 'nokogiri' | |
| doc = Nokogiri::XML(File.read(ARGV[0])) | |
| puts doc.xpath("/xmlns:Resume/xmlns:StructuredXMLResume/xmlns:EmploymentHistory/xmlns:EmployerOrg/xmlns:PositionHistory/xmlns:Title/text()") |
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
| xmllint --noout --schema http://ns.hr-xml.org/2_4/HR-XML-2_4/StandAlone/Resume.xsd <filename> |
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
| curl -d @<inputfile> <URL> > <outputfile> |
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
| history | cut -c8- | sort | uniq -c | sort -rn | head |
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
| ifconfig en0 | grep ether | awk '{print $2}' | sed 's/://g' |
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
| System.getProperties().list(System.out); |
OlderNewer