This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Websockets Test</title> | |
</head> | |
<body> | |
<script> | |
const socket = new WebSocket( | |
'wss://subscriptions.graph.cool/v1/__PROJECT_ID__','graphql-ws' | |
) | |
socket.addEventListener('open', event => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query { | |
p01: allArticles(first: 1000, skip: 0) { | |
... ArticleInfo | |
} | |
p02: allArticles(first: 1000, skip: 1000) { | |
... ArticleInfo | |
} | |
p03: allArticles(first: 1000, skip: 2000) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { render } from 'react-dom' | |
import TodoApp from './components/TodoApp' | |
import ApolloClient, { createNetworkInterface } from 'apollo-client' | |
import { registerGqlTag } from 'apollo-client/gql' | |
import { ApolloProvider } from 'react-apollo' | |
import { createStore, combineReducers, applyMiddleware } from 'redux' | |
import './style.css' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOCAL_PATH := $(call my-dir) | |
include $(CLEAR_VARS) | |
LOCAL_MODULE := nativemodule | |
LOCAL_SRC_FILES := NativeBridge.cpp | |
LOCAL_EXPORT_LDLIBS := -llog | |
LOCAL_LDLIBS := -llog | |
include $(BUILD_SHARED_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <jni.h> | |
#include <android/log.h> | |
extern "C" { | |
void Java_com_your_package_www_MainActivity_log(JNIEnv *env, jobject thiz); | |
}; | |
#define TAG "Native Android" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.opengl.Matrix; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class Cube { | |
private boolean isInitialized; | |
// PLANES | |
public static final int FACES_PER_CUBE = 6; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.opengl.GLES20; | |
import android.opengl.Matrix; | |
import com.google.vrtoolkit.cardboard.CardboardView; | |
import com.google.vrtoolkit.cardboard.Eye; | |
import com.google.vrtoolkit.cardboard.HeadTransform; | |
import com.google.vrtoolkit.cardboard.Viewport; | |
import javax.microedition.khronos.egl.EGLConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.os.Bundle; | |
import android.os.Vibrator; | |
import android.util.Log; | |
import com.google.vrtoolkit.cardboard.CardboardActivity; | |
import com.google.vrtoolkit.cardboard.CardboardView; | |
public class MainActivity extends CardboardActivity { | |
private SceneRenderer sceneRenderer; | |
private Vibrator vibrator; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/ui_layout" | |
android:orientation="vertical" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" > | |
<com.google.vrtoolkit.cardboard.CardboardView | |
android:id="@+id/cardboard_view" |