Skip to content

Instantly share code, notes, and snippets.

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:

@dequis
dequis / manage.sh
Last active August 29, 2015 14:06
enterprise twitpic management system
# enterprise twitpic management system
#
# requires tugboat for digital ocean management:
# gem install tugboat
# tugboat authorize
#
# usage:
# sh manage $droplet command1 command2 command3
#
# commands:
@dequis
dequis / playermoveevent.py
Created October 18, 2014 23:12
PlayerMoveEvent test plugin written in MiniPython
# ---
# name: Test
# version: 1.0
# author: dx
# ---
import quick
def format_location(l):
return "x=%.3f y=%.3f z=%.3f yaw=%.3f pitch=%.3f" % \
@dequis
dequis / playerinteractevent.py
Created November 3, 2014 07:09
PlayerInteractEvent test plugin written in MiniPython
# ---
# name: PlayerInteractEventTest
# ---
import quick
def msg(text):
quick.plugin.server.broadcastMessage(text)
def nice(text):
@dequis
dequis / scrape.sh
Created June 6, 2015 04:53
radare.today index generator/scraper. requires httpie, pup, jq https://github.com/radare/radare2/wiki/radare.today-index
baseurl=http://radare.today
maxpage=$(http -v HEAD $baseurl/page/9999/ | grep Location | grep -o '[0-9]*')
for page in $(seq 1 $maxpage); do
http --follow $baseurl/page/$page/ | pup -p 'h1.post-title a json{}' | jq '.[] | {"title": .text, "url": .href}' >> output.json
done
cat output.json | jq -r '" * [\(.title)]('$baseurl'\(.url))"' > result.md
@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