Skip to content

Instantly share code, notes, and snippets.

View callmephilip's full-sized avatar

Philip Nuzhnyi callmephilip

View GitHub Profile
// report spotting is declared through Meteor.methods({}) on the server
Meteor.call('reportSpotting',spotting, function(err,res){});
// poor man's Meteorjs
// endpoint should be : ws://yourapplication.meteor.com/websocket
var Meteor = {
call : function(methodName, params, callback){
var options = {
endpoint: ApplicationSettings.meteorSocketEndpoint,
SocketConstructor: WebSocket
};
chrome.runtime.onMessage.addListener(function(message, sender, sendResponse){
// look at the message and see if it has report data
// extract data and look for Meteor traces
// contact app server
// adjust UI
});
<!DOCTYPE html>
<html>
<head>
<script src="/scripts/settings.js"></script>
<script src="/scripts/archive.js"></script>
<script src="/scripts/identity.js"></script>
<script src="/scripts/ddp.js"></script>
<script src="/scripts/meteor.js"></script>
<script src="/scripts/background.js"></script>
</head>
var scripts = document.querySelectorAll("head > script") || [];
var reportData = [];
for(var i=0; i<scripts.length; i++){
if(scripts[i].innerHTML){
reportData.push({
content : scripts[i].innerHTML
});
}
}
@callmephilip
callmephilip / manifest.json
Created September 15, 2014 21:50
Configuring content scripts
"content_scripts": [
{
"matches": [
"http://*/*", "https://*/*"
],
"js": [
"scripts/inject.js"
],
"css": [
"css/animate.css",
@callmephilip
callmephilip / gist:8370014
Last active September 6, 2017 09:10
Building stuff using Meteor

Getting started with Meteor

Last weekend I finally got around to building something with Meteor and what follows is a short description of my experience with the platform with a few take aways.

Setup

Installing Meteor is super straightforward

$ curl https://install.meteor.com/ | sh
@callmephilip
callmephilip / chatzilla.deployment
Last active December 23, 2015 05:39
deploy chatzilla instance
git clone https://github.com/callmephilip/chatzilla.git
cd chatzilla
heroku login
heroku create
heroku labs:enable websockets -a YOUR-APP-NAME
git push heroku master
heroku open
@callmephilip
callmephilip / gist:6580321
Created September 16, 2013 12:54
Chatzilla gists
from gevent import monkey
from flask import Flask
monkey.patch_all()
application = Flask(__name__)
application.debug = True
application.config['PORT'] = 5000
@callmephilip
callmephilip / gist:5788592
Created June 15, 2013 16:10
full screen background image
//http://css-tricks.com/perfect-full-page-background-image/
html {
background: url(images/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}