Skip to content

Instantly share code, notes, and snippets.


Philip Nuzhnyi callmephilip

View GitHub Profile
callmephilip / manifest.json
Created Sep 15, 2014
Configuring content scripts
View manifest.json
"content_scripts": [
"matches": [
"http://*/*", "https://*/*"
"js": [
"css": [
View inject.js
var scripts = document.querySelectorAll("head > script") || [];
var reportData = [];
for(var i=0; i<scripts.length; i++){
content : scripts[i].innerHTML
View background.html
<!DOCTYPE html>
<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>
View background.js
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
View meteor.js
// poor man's Meteorjs
// endpoint should be : ws://
var Meteor = {
call : function(methodName, params, callback){
var options = {
endpoint: ApplicationSettings.meteorSocketEndpoint,
SocketConstructor: WebSocket
View call-meteor.js
// report spotting is declared through Meteor.methods({}) on the server'reportSpotting',spotting, function(err,res){});
callmephilip / gist:3430537
Created Aug 22, 2012
[Django] requiring a view to accept particular method(s)
View gist:3430537
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
# ...
callmephilip / gist:3430847
Created Aug 23, 2012
[CSS] box with an inset shadow
View gist:3430847
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;
callmephilip / gist:3445229
Created Aug 24, 2012
[Python] generate UUID
View gist:3445229
import uuid
callmephilip / gist:3445408
Created Aug 24, 2012
[Python Django] view decorator with parameters
View gist:3445408
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