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
setprompt(){ | |
if which acpi &> /dev/null; then | |
local BATTSTATE="$(acpi -b)" | |
local BATTPRCNT="$(echo ${BATTSTATE[(w)4]}|sed -r 's/(^[0-9]+).*/\1/')" | |
local BATTSTATUS="$(echo ${BATTSTATE[(w)3]})" | |
if [[ "${BATTSTATUS}" = "Discharging," ]]; then | |
if [[ -z "${BATTPRCNT}" ]]; then | |
PR_BATTERY="" | |
elif [[ "${BATTPRCNT}" -lt 15 ]]; then | |
PR_BATTERY="${fg[red]%}|${fg[red]} batt:${BATTPRCNT}%%" |
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
ZSH_THEME_SVN_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" | |
ZSH_THEME_SVN_PROMPT_SUFFIX="%{$reset_color%} " | |
ZSH_THEME_SVN_PROMPT_DIRTY="%{$fg[red]%} ✘ %{$reset_color%}" | |
ZSH_THEME_SVN_PROMPT_CLEAN=" " |
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
$ wget http://download.osgeo.org/proj/proj-datumgrid-1.4.tar.gz | |
$ mkdir nad | |
$ cd nad | |
$ tar xzf ../proj-datumgrid-1.4.tar.gz | |
$ nad2bin null < null.lla | |
$ sudo cp null /usr/share/proj |
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 form.is_valid(): | |
form.save() | |
response = JsonResponse(template.loader.render_to_string('email_results.html', context)) | |
print response.content | |
response.content = "<html><body><textarea>%s</textarea></body></html>" % response.content | |
response['Content-Type'] = 'text/html' | |
return response | |
else: | |
response = JsonResponse(error=iriencode(context['form'].as_p())) | |
response.content = "<html><body><textarea>%s</textarea></body></html>" % response.content |
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
var internal_form = dijit.byId('internal-invite'); | |
dojo.connect(internal_form, 'success', function(res){ | |
dojo.place(unescape(res.result), internal_form.domNode, 'only'); | |
$(document).bind('cbox_closed', function(){ | |
location.reload(); | |
}); | |
}); | |
$(".invite-popup").colorbox({height:"300px;", width:"600px;", inline:true, href:"#colorbox-form-internal"}); |
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
<div style='display:none;'> | |
<h1>Invite Testers</h1> | |
<div id='colorbox-form-internal'> | |
<h1>Invite Internal Testers</h1> | |
<div style="text-align:center; margin-top:20px"> | |
<form id='internal-invite' data-dojo-type='Form' data-dojo-props="method:'post', action:'{% url invitations_internal_app_access app.id %}', | |
enctype:'multipart/form-data'"> | |
{% csrf_token %} | |
<script type="text/javascript" src="{{STATIC_URL}}js/selectall.js"></script> | |
<input name="checkall" onclick="checkUncheckAll(this);"type="checkbox" /> <b> Select All </b> |
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 request.method == 'POST': | |
form = UploadFileForm(request.POST, request.FILES) | |
if form.is_valid(): | |
form.save() |
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
<form enctype='multipart/form-data' form action='.' method='post'> |
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
import os | |
from autoslug import AutoSlugField | |
def issue_screenshot_path(screenshots,filename): | |
''' | |
Returns the filepath where the screenshot of this issue is store. | |
''' | |
return os.path.join('qa/issue/screenshots', '%s' %(screenshots.slug,)) |
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 comma_sep(bits): | |
count = dict() | |
orderedCounts = list() # counts, ordered | |
for bit in bits: | |
# if key exists | |
if count.has_key(bit): | |
count[bit] += 1 | |
else: # key does not exist | |
count[bit] = 1 | |
string = "" |
NewerOlder