Skip to content

Instantly share code, notes, and snippets.

View N3MIS15's full-sized avatar

David Gray N3MIS15

View GitHub Profile
@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')
@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 / 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 / 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 / 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: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 / 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>
#!/usr/bin/env python
#########################################################################
# Boblight config generator created by David Gray (N3MIS15) #
# Positioning is calculated starting at the middle bottom of screen #
# Only has barebone settings, any other setting should be set manually #
# Tested with adafruit 8806 LEDs and adalight #
#########################################################################
@N3MIS15
N3MIS15 / gist:5403299
Created April 17, 2013 10:33
rom test hackery
#!/usr/bin/env python
#
# Copyright (C) 2013 Garrett Brown
# See Copyright Notice in rominfo.py
import testutils
import unittest
import os
import json
@N3MIS15
N3MIS15 / addon.xml
Created April 28, 2013 22:31
test trakt addon rating
<?xml version="1.0" encoding="UTF-8"?>
<addon id="plugin.video.rate_test" version="0.0.1" name="Test Trakt Ratings" provider-name="N3MIS15">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.xbmcswift2" version="2.4.0" />
</requires>
<extension point="xbmc.python.pluginsource" library="plugin.py">
<provides>video</provides>
</extension>
<extension point="xbmc.addon.metadata">