Skip to content

Instantly share code, notes, and snippets.

Dan Ristic dristic

Block or report user

Report or block dristic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
foo: [],
init: function () {
let arr = [];
for (let i = 0; i < 1000; i++) {
arr.push('Test' + Math.random());
dristic /
Created Jul 15, 2014
Keybase Verification

Keybase proof

I hereby claim:

  • I am dristic on github.
  • I am dristic ( on keybase.
  • I have a public key whose fingerprint is 3A49 BD33 6BF7 4DBF 6B77 13AD 3CB8 2B60 B08E B032

To claim this, I am signing this object:

dristic / main.js
Created Aug 28, 2013
PubNub basic publish
View main.js
var pubnub = PUBNUB.init({
publish_key: 'demo',
subscribe_key: 'demo'
channel: "myChannel",
callback: function (message) {
console.log("I got the message: " + message);
dristic / collection.js
Last active Dec 21, 2015
Code snippets for integrating Backbone with PubNub via
View collection.js
var MyCollection = Backbone.PubNub.Collection.extend({
name: 'MyCollection',
pubnub: pubnub
dristic / webrtc.js
Last active Apr 5, 2020
Full code from my WebRTC Data Channel post.
View webrtc.js
// Fix Vendor Prefixes
var IS_CHROME = !!window.webkitRTCPeerConnection,
if (IS_CHROME) {
RTCPeerConnection = webkitRTCPeerConnection;
RTCIceCandidate = window.RTCIceCandidate;
RTCSessionDescription = window.RTCSessionDescription;
dristic / 1.js
Last active Jul 18, 2016 — forked from ToeJamson/1.js
View 1.js
navigator.geolocation.getCurrentPosition(function (position) {
console.log(“I am located at: + position.coords.latitude + , + position.coords.longitude);
navigator.geolocation.watchPosition(function (position) {
console.log(“I am now located at: + position.coords.latitude + , + position.coords.longitude);
dristic / pubnub-based.js
Created Jul 31, 2013
WebRTC Data Channel Examples.
View pubnub-based.js
var pubnub = PUBNUB.init({
publish_key: 'demo',
subscribe_key: 'demo'
// Here is where you can use PubNub Presence to get the UUID of the other user
// var uuid = 'ABC123'
user: uuid, // This tells PubNub to use WebRTC Data Channel
dristic / messenger.appcache
Created Jun 3, 2013
PubNub Messenger appcache.
View messenger.appcache
# 2013-05-13:v1.3.2
# Explicitly cached master entries.
dristic / index.html
Created May 29, 2013
Adding presence to PubNub Messenger.
View index.html
<div data-role="page" id="chatPage" data-theme="c" class="type-interior">
<div data-role="content">
<div class="content-primary">
<div data-role="header" data-position="fixed" data-tap-toggle="false">
<h1>Pub Messenger</h1>
</div><!-- /header -->
<div data-role="content">
<ul data-role="listview" id="messageList">
dristic / messenger.js
Created May 28, 2013
Adding history to PubNub Messenger.
View messenger.js
channel: chatChannel,
limit: 100
}, function (messages) {
messages = messages[0];
messages = messages || [];
for(var i = 0; i < messages.length; i++) {
handleMessage(messages[i], false);
You can’t perform that action at this time.