How to use pusher - 8 common examples

To help you get started, we’ve selected a few pusher examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Trojan13 / NodeBitSkins / test2.js View on Github external
function initiatePusher() {
    
    var pusher = Pusher.forCluster("notifier.bitskins.com", {
  appId: '',
  key: '',
  secret: 'SECRET_KEY',
  encrypted: true, // optional, defaults to false 
  port: 443, // optional, defaults to 80 for unencrypted and 443 for encrypted 
});
    
    Pusher.host = 'notifier.bitskins.com';
    Pusher.ws_port = 443;
    Pusher.wss_port = 443;
    pusher = new Pusher(apiKey, {
        encrypted: true
        , disabledTransports: ['sockjs']
        , disableStats: true
    });
github Trojan13 / NodeBitSkins / test2.js View on Github external
function initiatePusher() {
    
    var pusher = Pusher.forCluster("notifier.bitskins.com", {
  appId: '',
  key: '',
  secret: 'SECRET_KEY',
  encrypted: true, // optional, defaults to false 
  port: 443, // optional, defaults to 80 for unencrypted and 443 for encrypted 
});
    
    Pusher.host = 'notifier.bitskins.com';
    Pusher.ws_port = 443;
    Pusher.wss_port = 443;
    pusher = new Pusher(apiKey, {
        encrypted: true
        , disabledTransports: ['sockjs']
        , disableStats: true
    });
    
    pusher.trigger('connected', 'test_event', { function () {
        chatChannelSubscribe = pusher.subscribe("chat-channel");
        chatChannelSubscribe.bind('chat_message', function (data) {
            processChatData(data);
        });
}
                                              });
}
github Trojan13 / NodeBitSkins / test2.js View on Github external
function initiatePusher() {
    
    var pusher = Pusher.forCluster("notifier.bitskins.com", {
  appId: '',
  key: '',
  secret: 'SECRET_KEY',
  encrypted: true, // optional, defaults to false 
  port: 443, // optional, defaults to 80 for unencrypted and 443 for encrypted 
});
    
    Pusher.host = 'notifier.bitskins.com';
    Pusher.ws_port = 443;
    Pusher.wss_port = 443;
    pusher = new Pusher(apiKey, {
        encrypted: true
        , disabledTransports: ['sockjs']
        , disableStats: true
    });
    
    pusher.trigger('connected', 'test_event', { function () {
        chatChannelSubscribe = pusher.subscribe("chat-channel");
        chatChannelSubscribe.bind('chat_message', function (data) {
            processChatData(data);
        });
}
                                              });
}
function processChatData(data) {
github Trojan13 / NodeBitSkins / test2.js View on Github external
function initiatePusher() {
    
    var pusher = Pusher.forCluster("notifier.bitskins.com", {
  appId: '',
  key: '',
  secret: 'SECRET_KEY',
  encrypted: true, // optional, defaults to false 
  port: 443, // optional, defaults to 80 for unencrypted and 443 for encrypted 
});
    
    Pusher.host = 'notifier.bitskins.com';
    Pusher.ws_port = 443;
    Pusher.wss_port = 443;
    pusher = new Pusher(apiKey, {
        encrypted: true
        , disabledTransports: ['sockjs']
        , disableStats: true
    });
    
    pusher.trigger('connected', 'test_event', { function () {
        chatChannelSubscribe = pusher.subscribe("chat-channel");
        chatChannelSubscribe.bind('chat_message', function (data) {
            processChatData(data);
        });
}
                                              });
}
function processChatData(data) {
github arscan / encom-boardroom / src / Boardroom.js View on Github external
Boardroom.show = function(cb){
    startDate = new Date();
    lastTime = Date.now();

    $("#boardroom").css({"visibility": "visible"});
    for(var i = 0; i< 20; i++){
        locationAreaColors[i] = pushercolor('#00eeee').blend('#ffcc00', i/20).hex6();
    }

    //animate();

    // render the other elements intro animations

    $(".footer-bar").delay(1000).animate({"margin-top": "0"}, 500);

    $("#globe-footer img").delay(1500).animate({"opacity": "1"}, 1000);

    $("#globalization").delay(600).animate({
        top: "0px",
        left: "0px",
        width: "180px"
    }, 500);
github arscan / encom-globe / src / Globe.js View on Github external
side: THREE.DoubleSide
    });

    var triangles = this.tiles.length * 4;

    var geometry = new THREE.BufferGeometry();

    geometry.addAttribute( 'index', Uint16Array, triangles * 3, 1 );
    geometry.addAttribute( 'position', Float32Array, triangles * 3, 3 );
    geometry.addAttribute( 'normal', Float32Array, triangles * 3, 3 );
    geometry.addAttribute( 'color', Float32Array, triangles * 3, 3 );
    geometry.addAttribute( 'lng', Float32Array, triangles * 3, 1 );

    var lng_values = geometry.attributes.lng.array;

    var baseColorSet = pusherColor(this.baseColor).hueSet();
    var myColors = [];
    for(var i = 0; i< baseColorSet.length; i++){
        myColors.push(baseColorSet[i].shade(Math.random()/3.0));
    }

    // break geometry into
    // chunks of 21,845 triangles (3 unique vertices per triangle)
    // for indices to fit into 16 bit integer number
    // floor(2^16 / 3) = 21845

    var chunkSize = 21845;

    var indices = geometry.attributes.index.array;

    for ( var i = 0; i < indices.length; i ++ ) {
github arscan / encom-boardroom / src / Box.js View on Github external
for(var i = 0; i< this.boxWidth * this.boxDepth; i++){
        var x = i % this.boxWidth - this.boxWidth/2;
        var z = (Math.floor(i / this.boxDepth) -this.boxDepth/2 );
        var vertex = new THREE.Vector3();
        vertex.x = x;
        vertex.y = (this.boxHeight)*Math.sin(x/8)*Math.cos(z/8) * (((this.boxDepth/2)-Math.abs(x))/this.boxWidth/2) * ((this.boxDepth/2-Math.abs(z))/this.boxDepth/2);
        vertex.z = z;
        this.particleGeometry.vertices.push( vertex );
        this.shaderAttributes.color.value[i] = new THREE.Color(0x00eeee);
        this.shaderAttributes.opacity.value[i] = 0.0;
    }

    this.particleColors = [];

    for(var i = 0; i< 5; i++){
        this.particleColors.push(new THREE.Color(pushercolor("#00eeee").blend("#ffcc00", i/4).hex6()));
    }

    var particleSystem = new THREE.ParticleSystem( this.particleGeometry, this.shaderMaterial);

    this.scene.add( particleSystem);

    this.frameGeometry = new THREE.Geometry();
    var frameMaterial = new THREE.LineBasicMaterial({
        color: 0xFFFFFF,
        opacity: .5,
        transparent: true
    });

    var maxTime = 2000;

    this.frameSegments = [];
github andvote / andvote / server / controllers / voteController.js View on Github external
FROM pollOptions
             WHERE pollOptions.pollId = (
               SELECT pollOptions.pollId
               FROM pollOptions
               WHERE pollOptions.id = ${db.sequelize.escape(req.body.pollOptionId)}
             ))
          `)
        }
      }
    })
    if (foundVote === null) {
      await db.models.vote.create({
        voterIp: req.ip,
        pollOptionId: req.body.pollOptionId
      })
      var pusher = new Pusher({
        appId: process.env.PUSHER_APP_ID,
        key: process.env.PUSHER_APP_KEY,
        secret: process.env.PUSHER_APP_SECRET
      })
      const foundPoll = await db.models.poll.findOne({
        where: {
          id: req.body.pollId
        },
        group: ['pollOptions.id'],
        order: [[db.sequelize.literal('`pollOptions.voteCount`'), 'ASC']],
        attributes: ['question'],
        include: {
          model: db.models.pollOption,
          attributes: [
            ['id', 'optionId'],
            'text',

pusher

Node.js client to interact with the Pusher Channels REST API

MIT
Latest version published 1 year ago

Package Health Score

62 / 100
Full package analysis