Skip to content

Instantly share code, notes, and snippets.

def url(self, *args, **kwargs): # pylint: disable=arguments-differ
# Use CloudFront domain instead of S3
url = urlparse(super().url(*args, **kwargs))
url.netloc = settings.SLIDE_CONVERTED_CLOUDFRONT_DOMAIN
return url.geturl()
def test_create_and_search(self):
other_course = mommy.make('courses.Course')
mommy.make('courses.Membership', member=self.user, course=other_course)
other_topic = mommy.make('courses.Topic', course=other_course)
other_slideshow = mommy.make('slides.Slideshow', topic=other_topic)
self.create_slide_doc(self.slideshow, 11, 'Some other words to interfere with the words we are matching')
self.create_slide_doc(self.slideshow, 12, 'Apple banana pear fruit and some other delicious stuff')
self.create_slide_doc(self.slideshow, 13, 'Books and records are also items')
self.create_slide_doc(self.slideshow, 14, 'And some guitars, basses, fiddles, synthesizers')
" ~/.config/nvim/init.vim
" Author: Max Lay
if &compatible
set nocompatible
endif
" Plugins
" Add the dein installation directory into runtimepath
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim
call dein#begin(expand('~/.vim/dein')) " plugins' root path
" ~/.config/nvim/init.vim
" Author: Max Lay
if &compatible
set nocompatible
endif
" Plugins
" Add the dein installation directory into runtimepath
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim
call dein#begin(expand('~/.vim/dein')) " plugins' root path
" ~/.config/nvim/init.vim
" Author: Max Lay
if &compatible
set nocompatible
endif
" Plugins
" Add the dein installation directory into runtimepath
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim
call dein#begin(expand('~/.vim/dein')) " plugins' root path
// Load n more call records into a list
loadN(list, n) {
var pages = this.get('pages');
// This serves two purposes, allowing us to access the contents of the pages,
// but also preventing us from making concurrent requests and screwing up the
// ordering
return Ember.RSVP.all(pages).then(pagesData => {
// We want to be adding items from the start if we currently have no items
var addingItems = list.length == 0;
// Loop through pages while there are still pages to go through, and we
@kalda341
kalda341 / ethereum_ubuntu.bash
Created June 29, 2017 05:51
ethereum_ubuntu.bash
sudo apt-get install software-properties-common
sudo apt-get install amdgpu-pro
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum ethminer
#geth account new
ethminer --farm-recheck 200 -S eu1.ethermine.org:4444 -FS us1.ethermine.org:4444 -O 0x5040705407fa18d72ae8ea23f91e22e68c5a7197.work
// Seconds since call started, if a call is in progress
call_time: Ember.computed('user.activeLiveCallAgents.[]', '[email protected]', '_call_time', function() {
var self = this;
// Basically, we want a way of having call_time update every second,
// but only if a call is in progress.
// We achieve that by having a timer update a property we are listening on,
// which will start when the call time is requested, and stop when there
// is no call in progress. We enforce that there is only ever one timer
// running for an agent.
for (bi=0; bi<size; bi+=block_size){
for (bj=0; bj<size; bj+=block_size){
//Handle cases where size%block_size!=0
max_j = (bi+block_size<=size)?block_size:size%block_size;
max_k = (bj+block_size<=size)?block_size:size%block_size;
for (i=0; i<block_size; i++){
for (j=0; j<max_j; j++){
for (k=0; k<max_k; k++){
result[i*size+(bi+j)] += A[i*size+(bj+k)] * B[(bj+k)*size+(bi+j)];
}
@Test
public void testAlbumResourceLongPoll() throws InterruptedException, ExecutionException, TimeoutException {
Client client = ClientBuilder.newClient();
Client asyncClient = ClientBuilder.newClient();
Client getAlbumClient = ClientBuilder.newClient();
try {
final String albumTitle = "My Squelchy Life";
AlbumDTO album = new AlbumDTO();