Command: heroku pgbackups:capture --remote production
Response: >>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712
Command: heroku pgbackups:url [db_key] --remote production
| # (C) Mathieu Blondel, November 2013 | |
| # License: BSD 3 clause | |
| import numpy as np | |
| def ranking_precision_score(y_true, y_score, k=10): | |
| """Precision at rank k | |
| Parameters |
| require 'fiddle' | |
| module Python | |
| def __class__= k | |
| value = _wrap self | |
| [k.object_id<<1].pack('Q').unpack('C8').each_with_index {|n,i|value[i+8]=n} | |
| end | |
| def _wrap klass; Fiddle::Pointer.new Fiddle.dlwrap klass; end | |
| end |
| #!/usr/bin/env bash | |
| # This script prints out all of your Redis keys and their size in a human readable format | |
| # Copyright 2013 Brent O'Connor | |
| # License: http://www.apache.org/licenses/LICENSE-2.0 | |
| human_size() { | |
| awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } ' | |
| } |
| var MyModel = Backbone.Model.extend({ | |
| someMethod: function(opts) { | |
| var url = this.url() + '/someMethod', | |
| // note that these are just $.ajax() options | |
| options = { | |
| url: url, | |
| type: 'POST' | |
| }; | |
| // add any additional options, e.g. a "success" callback or data |
| from celery import chain | |
| from django.core.management.base import BaseCommand | |
| from . import tasks | |
| class Command(BaseCommand): | |
| def handle(self, *args, **kwargs): |
| require 'formula' | |
| # some credit to http://github.com/maddox/magick-installer | |
| # NOTE please be aware that the GraphicsMagick formula derives this formula | |
| def ghostscript_srsly? | |
| ARGV.include? '--with-ghostscript' | |
| end | |
| def x11? |