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
"content_scripts": [ | |
{ | |
"matches": [ | |
"http://*/*", "https://*/*" | |
], | |
"js": [ | |
"scripts/inject.js" | |
], | |
"css": [ | |
"css/animate.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
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 | |
}); | |
} | |
} |
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
<!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> |
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
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 | |
}); |
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
// 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 | |
}; |
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
// report spotting is declared through Meteor.methods({}) on the server | |
Meteor.call('reportSpotting',spotting, function(err,res){}); |
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
from django.views.decorators.http import require_http_methods | |
@require_http_methods(["GET", "POST"]) | |
def my_view(request): | |
# I can assume now that only GET or POST requests make it this far | |
# ... | |
pass |
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
{ | |
background: white; | |
border-radius: 5px; | |
padding: 20px; | |
-moz-box-shadow: inset 0 0 5px #999; | |
-webkit-box-shadow: inset 0 0 6px #757575; | |
box-shadow: inner 0 0 5px #999; | |
} |
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 uuid | |
uuid.uuid1().hex |
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
from functools import wraps | |
from django.utils.decorators import available_attrs | |
def my_decorator(parameter_name): | |
def decorator(view_func): | |
@wraps(view_func, assigned=available_attrs(view_func)) | |
def _wrapped_view(request, *args, **kwargs): | |
return view_func(request, *args, **kwargs) | |
return _wrapped_view |
OlderNewer