<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>
-
URL
<The URL Structure (path only, no root url)>
-
Method:
| import time | |
| from django.utils.http import http_date | |
| AJAX_NEGATIVE_CHECK_EXPIRES = 60 # object is still available | |
| AJAX_POSITIVE_CHECK_EXPIRES = 60*10 # if object is not available (or taken) | |
| def check_ajax(request): | |
| # do stuff here | |
| timeout = AJAX_NEGATIVE_CHECK_EXPIRES if avail else AJAX_POSITIVE_CHECK_EXPIRES |
| <?php | |
| $fileName = $_FILES['afile']['name']; | |
| $fileType = $_FILES['afile']['type']; | |
| $fileContent = file_get_contents($_FILES['afile']['tmp_name']); | |
| $dataUrl = 'data:' . $fileType . ';base64,' . base64_encode($fileContent); | |
| $json = json_encode(array( | |
| 'name' => $fileName, | |
| 'type' => $fileType, | |
| 'dataUrl' => $dataUrl, |
| #!/usr/bin/env bash | |
| ## | |
| # The dimensions for the physical QR code, in pixels. | |
| # The Brother QL-570 Label Printer tape is 2.44" wide | |
| # at 72ppi, and 72 * 2.44 = 175.68, so 175 is good. | |
| size=175x175 | |
| ## | |
| # Usage: qrcode [url] |
| # First remove *all* keybindings | |
| unbind-key -a | |
| # Now reinsert all the regular tmux keys | |
| bind-key C-b send-prefix | |
| bind-key C-o rotate-window | |
| bind-key C-z suspend-client | |
| bind-key Space next-layout | |
| bind-key ! break-pane | |
| bind-key \" split-window |
| """ | |
| This gist demonstrates that spark 1.0.0 and 0.9.1 | |
| don't serialize a logger instance properly when code runs on workers. | |
| run this code via: | |
| spark-submit spark_serialization_demo.py | |
| - or - | |
| pyspark spark_serialization_demo.py | |
| """ | |
| import pyspark |
| function computeHttpSignature(config, headerHash) { | |
| var template = 'keyId="${keyId}",algorithm="${algorithm}",headers="${headers}",signature="${signature}"', | |
| sig = template; | |
| // compute sig here | |
| var signingBase = ''; | |
| config.headers.forEach(function(h){ | |
| if (signingBase !== '') { signingBase += '\n'; } | |
| signingBase += h.toLowerCase() + ": " + headerHash[h]; | |
| }); |
This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :
| import os, argparse | |
| import tensorflow as tf | |
| from tensorflow.python.framework import graph_util | |
| dir = os.path.dirname(os.path.realpath(__file__)) | |
| def freeze_graph(model_folder, output_nodes='y_hat', | |
| output_filename='frozen-graph.pb', | |
| rename_outputs=None): |