Skip to content

Instantly share code, notes, and snippets.

View gazpachoking's full-sized avatar

Chase Sterling gazpachoking

View GitHub Profile
@gazpachoking
gazpachoking / gist:97d33e86280f9f6f7c2f
Created March 25, 2015 17:46
Steve's addons mouseover crash
---- Minecraft Crash Report ----
// I let you down. Sorry :(
Time: 3/25/15 1:40 PM
Description: Rendering screen
java.lang.NullPointerException: Rendering screen
at net.minecraftforge.fluids.FluidStack.getLocalizedName(FluidStack.java:105)
at stevesaddons.asm.StevesHooks.getContentString(StevesHooks.java:184)
at stevesaddons.asm.StevesHooks.fixToolTip(StevesHooks.java:159)
@gazpachoking
gazpachoking / save_cookies.py
Last active August 29, 2015 14:06
Saves and loads cookies for a requests Session to a file
import os
from cookielib import LWPCookieJar
import requests
s = requests.Session()
s.cookies = LWPCookieJar('cookiejar')
if not os.path.exists('cookiejar'):
# Create a new cookies file and set our Session's cookies
@gazpachoking
gazpachoking / trac2down.py
Last active August 29, 2015 13:57 — forked from sgk/trac2down.py
Converts a trac wiki dump from WikiFormatting to GFM suitable for use on a github wiki
"""Usage: trac2down <trac wiki dump path>"""
from __future__ import unicode_literals
import codecs
import os
import re
import sys
def convert_wiki_link(link):
if link.startswith('wiki:'):
def merge_settings(request_setting, session_setting, dict_class=OrderedDict):
"""
Determines appropriate setting for a given request, taking into account the setting on that
request, and the setting in the session. If a setting is a dictionary, they will be merged together
using `dict_class`
"""
if session_setting is None:
return request_setting
[
{
"description": "remote ref",
"schema": {"$ref": "http://localhost:1234/integer.json"},
"tests": [
{
"description": "remote ref valid",
"data": 1,
"valid": true
},
@gazpachoking
gazpachoking / set_torrent_comment.py
Created November 13, 2012 18:48
Plugin to set the comment in a torrent
import logging
from flexget.plugin import priority, register_plugin
from flexget.utils.template import RenderError
log = logging.getLogger('set_torrent_comment')
class SetTorrentComment(object):
"""
Changes comment in torrent file
@gazpachoking
gazpachoking / gist:3984489
Created October 31, 2012 02:38
deluge stable sort
Index: deluge/ui/gtkui/listview.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
<+># -*- coding: utf-8 -*-\n#\n# listview.py\n#\n# Copyright (C) 2007, 2008 Andrew Resch <andrewresch@gmail.com>\n#\n# Deluge is free software.\n#\n# You may redistribute it and/or modify it under the terms of the\n# GNU General Public License, as published by the Free Software\n# Foundation; either version 3 of the License, or (at your option)\n# any later version.\n#\n# deluge is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n# See the GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with deluge. If not, write to:\n# The Free Software Foundation, Inc.,\n# 51 Franklin Street, Fifth Floor\n# Boston, MA 0
@gazpachoking
gazpachoking / gist:3908383
Created October 17, 2012 21:33
npyscreen test
import npyscreen
tree_data = npyscreen.NPSTreeData()
tree_data.newChild(content={'a': 1})
tree_data.newChild(content={'b': 2})
class MyTreeLineAnnotated(npyscreen.TreeLineAnnotated):
def getAnnotationAndColor(self):
# AHH, self.value is an empty str, this fails.
content = self.value.getContent()
@gazpachoking
gazpachoking / gist:3889680
Created October 14, 2012 20:14
seed series databas
presets:
presetwithyourseriesconfig:
# your series config, (or import_series) goes here
tasks:
seed_series_db:
find:
regexp: .*(avi|mkv)$
path: /my/series
preset: presetwithyourseriesconfig
manual: yes
@gazpachoking
gazpachoking / my_filters.py
Created March 6, 2012 20:41
FlexGet plugin which adds custom jinja filters
"""
This plugin just registers more functions as jinja filters. You can then use the filters from any
jinja template in FlexGet like normal. e.g. {{afield|myfilter}}
"""
import logging
log = logging.getLogger('my_filters')
def filter_myfilter(val):