Not only that, but it is full of other great features too!
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
$ dig @8.8.8.8 www.rabbitmq.com +noall +comments +answer | |
; <<>> DiG 9.7.3-P3 <<>> @8.8.8.8 www.rabbitmq.com +noall +comments +answer | |
; (1 server found) | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19482 | |
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 | |
;; ANSWER SECTION: |
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
#!/bin/bash | |
function start { | |
./manage.py runfcgi host=127.0.0.1 port=8080 | |
} | |
function stop { | |
PIDS=`ps aux |grep manage.py | grep -v grep|awk '{print $2}'` | |
kill $PIDS |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.programmerNotebook.StartPeriodically</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/bin/mvim</string> | |
<string>-c</string> |
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
#DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' | |
image_request = requests.get(url) | |
content_type=image_request.headers['content-type'] | |
filename = 'blarg' | |
if content_type == 'image/jpeg': | |
filename = "blarg.jpg" | |
if content_type == 'image/png': | |
filename = "blarg.png" | |
image_file = SimpleUploadedFile( |
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
node.django_apps.each do |key,value| | |
django_app = value | |
djangoapp_build_repo django_app.branch do | |
action :add | |
settings django_app.settings | |
repo django_app.repo | |
app_name django_app.app_name | |
env_root django_app.env_root | |
app_user django_app.app_user | |
not_if { File.directory? "#{django_app.env_root}/#{django_app.app_name}-env" } |
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
#!/usr/bin/env python | |
import xmlrpclib | |
import pip | |
pypi = xmlrpclib.ServerProxy('http://pypi.python.org/pypi') | |
for dist in pip.get_installed_distributions(): | |
available = pypi.package_releases(dist.project_name) | |
if not available: | |
# Try to capitalize pkg name |
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
// * Somewhere in your html, you'll need a place to put the graph (flotcharts.org) | |
// <div class="graph-container"> | |
// <div id="userGraph" class=graph-placeholder></div> | |
// </div> | |
// * You'll also need the data available to the js | |
// * This should probably go near the bottom. Like just before the </body> tag. | |
// <script> | |
// {% autoescape off %} | |
// GRAPHABLE_DATA = {{ report_as_json }} | |
// {% endautoescape %} |
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
from django.conf import settings | |
from django.core.mail import EmailMultiAlternatives | |
from django.db import models | |
from django.template import Template, Context ,loader | |
from django.contrib.sites.models import Site | |
def resolve_template(template): | |
"Accepts a template object, path-to-template or list of paths" | |
if isinstance(template, (list, tuple)): |
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 hashlib | |
def generate_avatar_url(addr, size): | |
default = 'mm'# or '404' or 'blank' | |
gravatar_base_url = 'http://www.gravatar.com/avatar/' | |
computed_hash = hashlib.md5(str(addr).lower().lstrip().rstrip()).hexdigest() | |
return '%s%s?d=%s&s=%s' % (gravatar_base_url, computed_hash, default, size) |
OlderNewer