Skip to content

Instantly share code, notes, and snippets.

/// This is a special string which indicates that no response will be received
/// for an RPC.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamingNoResponse {}
/// Generic Ack Message
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Ack {}
/// request the list of available plugins
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PluginListRequest {}
$ cargo test
running 134 tests
test ffi::bindgen_test_layout_FIT_ANT_RX_MESG_DEF ... ok
test ffi::bindgen_test_layout_FIT_ACTIVITY_MESG_DEF ... ok
test ffi::bindgen_test_layout_FIT_ACTIVITY_MESG ... FAILED
test ffi::bindgen_test_layout_FIT_ANT_RX_MESG ... FAILED
test ffi::bindgen_test_layout_FIT_ANT_TX_MESG ... FAILED
test ffi::bindgen_test_layout_FIT_ANT_TX_MESG_DEF ... ok
test ffi::bindgen_test_layout_FIT_BIKE_PROFILE_MESG_DEF ... ok
/* automatically generated by rust-bindgen */
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
@jacobh
jacobh / lr_restore.py
Created May 5, 2016 11:57
might have another version of this in gist already...
from __future__ import division
import multiprocessing
from multiprocessing.pool import Pool
import exifread
import arrow
import glob
import os
import records
import shutil
from PIL import Image
from __future__ import division
import multiprocessing
from multiprocessing.pool import Pool
import exifread
import arrow
import glob
import os
import records
import shutil
from PIL import Image
var TrackDownloadPanel = React.createClass({
propTypes: {
track: React.PropTypes.object
},
render: function () {
var audioUrls = _.get(this.props.track, "audio_urls", {})
return (
<div className="track-download__container">
<Button className="track-download__button" href={audioUrls.stream}>Download (Stream)</Button>
<Button className="track-download__button" href={audioUrls.archive}>Download (Archive)</Button>
class Base(object):
def test(self, text):
return 'base, ' + text
class One(object):
def test(self, text):
return 'one, ' + super(One, self).test(text)
class Two(object):
def test(self, text):
Traceback (most recent call last):
File "manage.py", line 18, in <module>
execute_from_command_line(sys.argv)
File "/Users/jacob/.virtualenvs/gizmag/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
utility.execute()
File "/Users/jacob/.virtualenvs/gizmag/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/jacob/.virtualenvs/gizmag/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Users/jacob/.virtualenvs/gizmag/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
toDigitsRev :: Integer -> [Integer]
toDigitsRev x
| x <= 0 = []
| otherwise = (x `mod` 10) : (toDigitsRev (x `div` 10))
toDigits :: Integer -> [Integer]
toDigits x = reverse (toDigitsRev x)
doubleEveryOther :: [Integer] -> [Integer]
doubleEveryOther [] = []

Current code:

class PaymentSummaryViewSet(viewsets.ModelViewSet):
    queryset = PaymentSummary.objects.all()
    serializer_class = PaymentSummarySerializer
 
    @action()
    def send(self, request, pk=None):
 # code to send individual payment summary