Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
"""
A pure Python "ping" implementation, based on a rewrite by Johannes Meyer,
of a script originally by Matthew Dixon Cowles. Which in turn was derived
from "ping.c", distributed in Linux's netkit. The version this was forked
out of can be found here: https://gist.github.com/pklaus/856268
The versions this script derived from are licensed under GPL v2, this makes
mandatory that this is licensed under the same terms as well. If it were up
from pycallgraph import PyCallGraph
from pycallgraph import Config
from pycallgraph import GlobbingFilter
from pycallgraph.output import GraphvizOutput
class ProfilerMiddleware(object):
includes = []
excludes = []
"""
Physics simulation with PyODE followed by a (basic) rendering with Vapory
See the result here: http://i.imgur.com/TdhxwGz.gifv
Zulko 2014
This script is placed in the Public Domain (Licence Creative Commons 0)
"""
@alex-bender
alex-bender / get_vk_songs_json.js
Last active April 26, 2016 16:58
code for getting song list json from vk.com
var hiddenFields = document.getElementsByTagName("input");
var mp3s = [];
function getHiddenField(elem, index, collection){
if(elem.getAttribute("type") == "hidden" && (/audio_info\d+_\d+/).test(elem.getAttribute("id"))){
mp3s.push({
'artist': elem.parentElement.nextSibling.nextSibling.childNodes[1].childNodes[0].textContent,
'title': elem.parentElement.nextSibling.nextSibling.childNodes[1].childNodes[2].textContent,
'url': elem.getAttribute("value").split(",")[0].split('?')[0]
});
}
@alex-bender
alex-bender / remote_debug.py
Created April 27, 2014 21:38
Remote debug simpe example.
# pip install rpdb
import rpdb
remote_deb = rpdb.Rpdb('localhost', port = 8000)
remote_deb.set_trace()