Skip to content

Instantly share code, notes, and snippets.

@dequis
dequis / pluginmanager.py
Created January 1, 2010 20:36
trimmed down PackageResource
'''Handles plugin importing'''
import os
import sys
import logging
log = logging.getLogger('pluginmanager')
class PackageResource:
'''Handle various files that could be put in the package'''
def __init__(self, base_dir, directory):
@dequis
dequis / gist:2925904
Created June 13, 2012 19:20
#mcdevs log, Jun 11 2012, timestamps are GMT-3
12:47 < dx> "Explosion (0x3C) - This command is not fully understood" :(
12:47 < dx> can't we cheat and ask Dinnerbone what's the fourth field of the explosion packet?
12:48 < Dinnerbone> What
12:48 < Dinnerbone> Uh
12:48 < dx> it says unknown on the wiki, "radius?" on the notes
12:48 < Dinnerbone> Range?
12:48 < Dinnerbone> Radius
12:48 < Dinnerbone> Yes
12:49 < dx> but why would it be included, if the record list includes all the blocks? or is it for the animation?
12:50 < Dinnerbone> I don't know :(
@dequis
dequis / freecam.py
Created July 7, 2012 20:36
Freecam plugin for mc3p
from mc3p.plugins import MC3Plugin, msghdlr
class FreecamPlugin(MC3Plugin):
def init(self, args):
self.freecam = False
self.last_pos = None
self.safe = True
self.abilities = None
@dequis
dequis / gist:3068521
Created July 7, 2012 23:13
mc3p asyncore based listener
diff --git a/mc3p/proxy.py b/mc3p/proxy.py
index d40627e..b2bc174 100644
--- a/mc3p/proxy.py
+++ b/mc3p/proxy.py
@@ -81,18 +81,25 @@ and forward that connection to <host>:<port>."""
return (host, port, opts, pcfg)
-def wait_for_client(port):
- """Listen on port for client connection, return resulting socket."""
@dequis
dequis / yaccparse.py
Created May 19, 2013 08:50
a script that reads a file and outputs the same file.
'''
Parses a yacc grammar file.
Also removes left recursion from the output.
That's all.
Licensed under the GNU LGPL. This is distributed in the hope that it
will be useful, but WITHOUT ANY WARRANTY, because it probably won't be.
See the GNU Lesser General Public License for more details.
'''
try:
from urllib.parse import quote
except ImportError:
# Python 2
from urllib import quote
import requests
# Session
ssomobile = "https://ssomobile.personal.com.ar/loginMobile/"
@dequis
dequis / ed.py
Created August 3, 2014 22:35
GNU Ed 2.0 (python version)
#!/usr/bin/env python
# GNU Ed 2.0 (python version)
#
# Copyright (C) 1994 Andrew L. Moore.
# Copyright (C) 2014 Free Software Foundation, Inc.
# Copyright (C) 2014 dx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

Keybase proof

I hereby claim:

  • I am dequis on github.
  • I am dx (https://keybase.io/dx) on keybase.
  • I have a public key whose fingerprint is 073F ACF0 DE15 A41B 182F 1915 4834 89D0 12FE 1773

To claim this, I am signing this object:

# logs from #irssi, 2014-03-19
# cleaned up to remove unrelated comments, empty lines added for readability where relevant
# i joined the channel in the middle of it to ask about something else
01:25 < tinypoodle> further trial shows the bug being triggered with any string after any amount of empty spaces at start of line, whenever hitting tab while cursor is not positioned after any character of string (i.e. at any position of empty space *or* on first char in string)
01:26 < tinypoodle> not sure if the description is fully clear...
01:28 < tinypoodle> the oddish part is that ineach case the cursor jumps to end of line instantly
01:28 < dx> tinypoodle: what am i supposed to see when i do what you described there?
01:29 < tinypoodle> dx: 3 lines of error messages, but only when done in status window
01:29 < dx> oh, yeah, i can reproduce that
@dequis
dequis / mcresources.py
Last active January 6, 2024 12:20
This script prints a list of URLs required to download all the minecraft resources that the new launcher can access (jars, libraries, assets) Redirect stdout to a file to do something useful with it.
"""
This script prints a list of URLs required to download all the minecraft
resources that the new launcher can access (jars, libraries, assets)
Redirect stdout to a file to do something useful with it.
Will store cached json indexes in
versions.json
versions/*.json