Skip to content

Instantly share code, notes, and snippets.

View N3MIS15's full-sized avatar

David Gray N3MIS15

View GitHub Profile
@N3MIS15
N3MIS15 / websock.html
Created November 29, 2012 09:06
Websocket XBMC keyboard remmote
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<title>XBMC Remote</title>
</head>
<body>
<h2>XBMC remote</h2>
@N3MIS15
N3MIS15 / gist:4014351
Created November 4, 2012 23:27
macros biatch
{% macro button(a) %}
<a class="button addloading" data-xhr_url="{{a}}">{{a|title}}</a>
{% endmacro %}
{{button('intro')}}
{{button('modules')}}
{{button('search')}}
{{button('remote')}}
{{button('servers')}}
{{button('manage')}}
@N3MIS15
N3MIS15 / gist:4014312
Created November 4, 2012 23:15
macro example
{% macro inline(title, href, img) %}
<div class="inline">
<a href="{{href}}" target="_blank">
<img title="{{title}}" src="{{img}}" height="40" width="40" alt="{{title}}">
<p style="font-size:75%;">{{title}}</p>
</a>
</div>
{% endmacro %}
@N3MIS15
N3MIS15 / gist:3985121
Created October 31, 2012 05:48
xbmc script
#!/usr/bin/env python
settings = {
'xbmc_hostname': '192.168.1.111',
'xbmc_port': '8080',
'xbmc_username': 'xbmc',
'xbmc_password': 'xbmc',
'xbmc_mac_address': '00:00:00:00:00:00',
'maraschino_url': 'http://127.0.0.1:7000/maraschino',
'maraschino_user': '',
@N3MIS15
N3MIS15 / setup.py
Created September 2, 2012 00:59
Build Maraschino as windows executable
########### EDIT ME ###########
# Location of Maraschino source
mara_dir = 'D:\\mara_exe\\source\\'
# Where to put the build directory
build_dir = 'D:\\mara_exe\\build\\'
# Destination of compiled Maraschino
dest_dir = 'D:\\mara_exe\\dest\\'
@N3MIS15
N3MIS15 / url_opener.py
Created August 15, 2012 00:55
simple URL opener script for maraschino
import datetime, getopt, sys, urllib, urllib2
def main(argv):
try:
opts, args = getopt.getopt(argv, "ipsw:", ["ip=", "port=", "script_id=", "webroot=", "url="])
except getopt.GetoptError:
sys.exit(2)
ip = None
@N3MIS15
N3MIS15 / gist:2976868
Created June 23, 2012 04:34
webroot stuff
if WEBROOT:
if WEBROOT[0] != '/':
WEBROOT = '/' + WEBROOT
d = wsgiserver.WSGIPathInfoDispatcher({WEBROOT: app})
else:
d = wsgiserver.WSGIPathInfoDispatcher({'/': app})
SERVER = wsgiserver.CherryPyWSGIServer(('0.0.0.0', PORT), d)
# Set up webroot for .less
less_webroot = os.path.join(RUNDIR, 'static/less/webroot.less')