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
ssh-reagent () { | |
for agent in /tmp/ssh-*/agent.*; do | |
export SSH_AUTH_SOCK=$agent | |
if ssh-add -l 2>&1 > /dev/null; then | |
echo Found working SSH Agent: | |
ssh-add -l | |
return | |
fi | |
done | |
echo Cannot find ssh agent - maybe you should reconnect and forward it? |
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
<html> | |
<head> | |
<title>Tip Calculator</title> | |
<script type="text/javascript"> | |
function createTaxCalculator(taxPercentage){ | |
return { | |
evaluateTax: function(preTipCost){ | |
return taxPercentage * preTipCost; | |
} | |
} |
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
["test1", | |
"test2" | |
] |
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
require File.expand_path(File.join(File.dirname(__FILE__), '../test_helper')) | |
require 'net/https' | |
require 'uri' | |
threads = [] | |
(1..32).each do |page| | |
threads << Thread.new(page) { |myPage| |
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
Just for fun, a commandline unshortner. | |
curl -i http://adf.ly/FPAiw | grep -o '/go.*' | sed "s/\';//" | xargs -I parturl curl -I http://adf.lyparturl | grep -o http.* | |
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
class MySearchIndex1(indexes.SearchIndex, indexes.Indexable): | |
author = indexes.CharField(model_attr='author') | |
pub_date = indexes.DateTimeField(model_attr='pub_date') | |
def get_model(self): | |
return MockModel | |
class MySearchIndex2(indexes.SearchIndex, indexes.Indexable): | |
author = indexes.CharField(model_attr='author') | |
pub_date = indexes.DateTimeField(model_attr='pub_date') |
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
def remove_html_tags(data, tag): | |
p = re.compile(r'<'+tag+'.*>(.*)</'+tag+'>') | |
return p.sub(r'\1', data) |