Skip to content

Instantly share code, notes, and snippets.

@kokeroulis
kokeroulis / ButterknifeConductor.kt
Created May 23, 2017 17:21 — forked from EricKuck/ButterknifeConductor.kt
Kotterknife(ish) view binding for Conductor controllers
// Largely borrowed from Jake Wharton's Kotterknife (https://github.com/JakeWharton/kotterknife)
// and paweljaneczek's PR for resetting cached views (https://github.com/JakeWharton/kotterknife/pull/37)
package com.bluelinelabs.conductor.butterknife
import android.view.View
import com.bluelinelabs.conductor.Controller
import java.util.Collections
import java.util.WeakHashMap
import kotlin.properties.ReadOnlyProperty
diff --git a/rxui-sample-java/src/main/java/com/artemzin/rxui/sample/java/MainPresenter.java b/rxui-sample-java/src/main/java/com/artemzin/rxui/sample/java/MainPresenter.java
index bdc556c..ddfa6d3 100644
--- a/rxui-sample-java/src/main/java/com/artemzin/rxui/sample/java/MainPresenter.java
+++ b/rxui-sample-java/src/main/java/com/artemzin/rxui/sample/java/MainPresenter.java
@@ -1,6 +1,7 @@
package com.artemzin.rxui.sample.java;
import android.support.annotation.NonNull;
+import android.util.Log;
@kokeroulis
kokeroulis / gist:0ada054573e3e2350820
Created March 1, 2016 13:58 — forked from alexwen/gist:4b337bc669509a696b5b
OkHttp Observable Callback
public Observable<FilesWrapper> download(List<Thing> things) {
return Observable.from(things)
.flatMap(thing -> {
File file = new File(getExternalCacheDir() + File.separator + thing.getName());
if (file.exists()) {
return Observable.just(file);
}
Request request = new Request.Builder().url(thing.getUrl()).build();
@kokeroulis
kokeroulis / gist:af2355f3552d2b9bee5b
Created January 23, 2016 19:11
OkHttp nested requests
// this is a singleton and it takes instance from dagger!
@Inject OkHttpClient client;
Subscription sub;
@Override
protected void onDestroy() {
super.onDestroy();
// Stop the request if our activity/fragment has been destroyed.
if (sub != null && !sub.isUnsubscribed()) {
sub.unsubscribe();
{
"data": [{
"type": "articles",
"id": "1",
"attributes": {
"title": "JSON API paints my bikeshed!"
},
"links": {
"self": "http://example.com/articles/1"
diff --git a/public/javascripts/models/channel.js b/public/javascripts/models/channel.js
index 3289365..acf083b 100644
--- a/public/javascripts/models/channel.js
+++ b/public/javascripts/models/channel.js
@@ -1,12 +1,28 @@
var utils = require('../utils.js');
-var ChannelModel = Ember.Object.extend({});
-ChannelModel.reopenClass({
+var ChannelModel = Ember.Object.extend({
diff --git a/public/javascripts/config/routes.js b/public/javascripts/config/routes.js
index 5164d7f..db499da 100644
--- a/public/javascripts/config/routes.js
+++ b/public/javascripts/config/routes.js
@@ -2,7 +2,7 @@ var App = require('./app');
App.Router.map(function() {
this.resource("channels", function() {
- this.resource("channel", {path: "/channel/:channelId"});
+ this.resource("channel", {path: "/channel/:channel_id"});
{
"auth": true,
"channels": [
{
"id": 3,
"image": "cardgames.png",
"name": "Card Games",
"description": "Bust out the deck of 52!",
"assetcount": 19
}
Assertion failed: an Ember.CollectionView's content must implement Ember.Array. You passed function () {
var sbList = Ember.Array();
this.channels.forEach(function(c) {
sbList.pushObject(ChannelsModel.find(c.id));
});
return sbList;
} application.js:727
Uncaught TypeError: Object function () {
var sbList = Ember.Array();
this.channels.forEach(function(c) {