Skip to content

Instantly share code, notes, and snippets.

// 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.
@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
// 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
" ~/.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
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')
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()
changeset: computed('_model', function() {
assert('validator must be set in siva-form', this.recordType);
let changeset = new Changeset(this._model, lookupValidator(this.validator), this.validator);
// ember-changeset, being the piece of shit that it is, doesn't consider something to be a 'change' if it
// doesn't validate. We want to know if there are unsaved changes, which we can't know if we don't keep track
// of it ourselves.
// List of {key, value}
this.set('changes', []);
class Ec2BaseCommand:
def __init__(self, resource):
# Set up some state
self.resource = resource
def __call__(self, suffix):
print('Build: "{}" with options [{}]'.format(self.resource, suffix))
command = Ec2BaseCommand('resource 123')