Our perfect Kombucha recipe

After months of testing, we have finally found the recipe that works best for our scobies in our location.

 

Everyone will have a slightly different outcome depending on the weather conditions of their city and scoby, but so far, in autumn, this is our #1

 

  • 3 Cups of White sugar
  • 45 grams of Dilmah loose leaf black tea.
  • 5.6 Liters of water
  1. After your sugar water has boiled, add in the tea.
  2. Let sit for 80 minutes.
  3. Then strain out tea and let cool
  4. When cool, add 2 cups of starter tea and your scoby.

Standard generic instructions for what to do next:

Let brew for 10 days or so, after about that amount of time, start tasting it daily, till it get’s how you like it, then when it is, remove scoby and put in plastic bottles, let sit till they are firm (upto 2weeks ish) then put in fridge for drinking.

 

 

Normalized recipe:

  • Half cup of sugar
  • 8 Grams of black tea
  • 1 Liter of water

 

Backbone Paginator Server Sorting

Recently I had to sort a collection using server mode (that is, doing a fetch for each page). It turns out this was not a simple as it seemed, needing to pass some extra options to the mode switching to stop the state being lost (as I could not set the pagination mode on the parent).

This is because I had some trouble with inheritance since I was using a child and parent collection. Here is the solution I found: (note the options in switchMode)

let parentCollection = Backbone.PageableCollection.extend({
  queryParams: {
    currentPage: ‘current_page’,
    pageSize: ‘page_size’,
    totalPages: ‘count’,
    sortKey: ‘sort’,
  },
})

let childCollection = parentCollection.extend({
  url: ‘/documents’,
  model: Entities.Document,
  comparator: Entities.DocumentCollectionComparator,

  doSort(field = ‘modified’, mode) {
    this.setSorting(field, mode === ‘des’ ? 1 : -1, {full: true})
    this.switchMode(‘server’, {fetch: true, resetState: false});
    this.sort()
  },
});

Nested Marionette Behaviors

Today I was having trouble with Nested Behaviors in Marionette 2.4.2.

The trouble was, how do I get options into my behaviors in behaviors?

Here is my situation:

view.js:

  View.Main = Marionette.ItemView.extend({
  ...
  behaviors: {
    // named so the sub behavior can access this!
    behaviorName: {
      data: 'someData',
      behaviorClass: BehaviorName,
    }
  }
  ...
});

Then inside of that Behavior:

BehaviorName.js:


...
// Note: using the unnamed array method to describe behaviors here, which came in as of 2.4.1
behaviors: [{
behaviorClass: NestedBehaviorName,
}],
...

So the problem then, is how do I get these the options from the parent into this sub behavior?

Here is what I ended up with:

NestedBehaviorName.js

  ... 
  initialize: function() {
    if (this.view.behaviors.BehaviorName) {
      _.extend(this.options, _.pick(this.view.behaviors.BehaviorName, ['data']));
    }
  },
  ...

Some recent spam

I got some spam recently, but they must have failed to parse their email correctly, so it came out raw, it is a little bit interesting. Though it was very long, here is a small snippet:

{
{I have|I’ve} been {surfing|browsing} online
more than {three|3|2|4} hours today, yet
I never found any interesting article like yours.

{It’s|It is} pretty worth enough for me. {In my opinion|Personally|In my view}, if
all {webmasters|site owners|website owners|web owners} and
bloggers made good content as you did, the {internet|net|web} will be {much more|a lot more} useful than ever before.|
I {couldn’t|could not} {resist|refrain from} commenting.
{Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I’ll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch} your {rss|rss feed} as I {can not|can’t} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink}
or {newsletter|e-newsletter} service. Do {you have|you’ve} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so
that|in order that} I {may just|may|could} subscribe.
Thanks.|
{It is|It’s} {appropriate|perfect|the best} time to make some plans for
the future and {it is|it’s} time to be happy. {I have|I’ve} read this post and if I could I {want
to|wish to|desire to} suggest you {few|some} interesting things or {advice|suggestions|tips}.
{Perhaps|Maybe} you {could|can} write next articles referring
to this article. I {want to|wish to|desire to} read {more|even more} things about it!|
{It is|It’s} {appropriate|perfect|the best} time to make {a few|some} plans for
{the future|the longer term|the long run} and {it is|it’s} time to be happy.
{I have|I’ve} {read|learn} this {post|submit|publish|put up} and if I {may just|may|could}
I {want to|wish to|desire to} {suggest|recommend|counsel} you {few|some} {interesting|fascinating|attention-grabbing} {things|issues} or {advice|suggestions|tips}.
{Perhaps|Maybe} you {could|can} write {next|subsequent} articles {relating to|referring to|regarding} this article.

Hope you get the {problem|issue} {solved|resolved|fixed} soon. {Kudos|Cheers|Many thanks|Thanks}|
This is a topic {that is|that’s|which is} {close to|near to} my heart…

Caps lock

Was ranting to grg today about how capslock is the worst key ever invented on a keyboard and how no one has ever used it ever.

Then I googled it, and found some other people agree: http://capsoff.org/history

Nice to know.

… the Caps Lock key has been little used, with some people claiming they use it deliberately only once or twice per year.

Publishing a Yeoman generator and its sub generators.

So I have a Yeoman generator that helps scaffold a Backbone.Marionette application using the module paradigm, which is all good.

Though I did get a little caught out when publishing the sub-generator component of it.

That is so you can do things like yo marionette-modules:module aSubModule, to get a module generated.

The :module part was not being registered in the Yeoman package when running yo --help.

The solution in the end is to add all folders you want to deploy into package.json before you publish eg:

“files”: [
“app”,
“module”
],