Skip to content

Instantly share code, notes, and snippets.

View mishudark's full-sized avatar
:octocat:
Rocking

mishudark mishudark

:octocat:
Rocking
View GitHub Profile
import tornado.httpserver, tornado.ioloop, tornado.options, tornado.web, os.path
from tornado.options import define, options
define("port", default=8888, help="run on the given port", type=int)
class Application(tornado.web.Application):
def __init__(self):
handlers = [
(r"/", HomeHandler),
(r"/upload", UploadHandler)
@mishudark
mishudark / gist:938717
Created April 23, 2011 15:51
paginator compatible with pymongo and mongoengine
# pagination.py
class Paginator(object):
def __init__(self, query, per_page):
"""Initialize a paginator.
Arguments:
- query -- queryset from pymongo or mongoengine
- per_page -- number of items per page
@mishudark
mishudark / corrupt.py
Created April 23, 2011 15:56 — forked from mattdennewitz/corrupt.py
python port of corrupt, for image disruption.
#!/usr/bin/env python
"""
corrupt
usage: ./corrupt.py --source=input.jpg [--output=corrupted.jpg] [--iterations=10]
originally: http://www.recyclism.com/corrupt.php
ported: @mattdennewitz
"""
@mishudark
mishudark / convore-bookmarklets.js
Created April 8, 2012 22:46 — forked from mal/convore-bookmarklets.js
Convore Usability Bookmarklets
// For use with convore.com
/*
* Automatically increase the size of the input field as you type
*/
javascript:void !function(a,b){var c=function(c){var d=$(this),e=parseInt(d.css("height")),f=c.keyCode===b||c.keyCode===13?19:this.scrollHeight,g;if(g=e-f)$("#message-list").css("margin-bottom",61+f),d.css("height",f),(g<0||a.scrollY<a.scrollMaxY)&&a.scroll(0,a.scrollY-g)};$("#footer").attr("style","height: auto !important"),$("#id-message").bind("keypress keyup",c).css("height",19),$("#post-message").find("input.btn").bind("click keyup",function(a){c.call($("#id-message"),a)})}(window)
/*
* Add permalinks to posts (click the time ago text)
* Based on previous work by balpha, https://convore.com/users/balpha/
@mishudark
mishudark / deck.md
Created June 9, 2012 22:28 — forked from pthrasher/deck.md
GistDeck for Charlotte Python Meetup

Who am I?

Philip Thrasher

Web hacker at a private cyber security company.

What I Do

@mishudark
mishudark / README-Template.md
Created July 21, 2019 08:36 — forked from ramantehlan/README-Fancy.md
README template I use for most of my projects.

Introduction

  • Add your project logo.
  • Write a short introduction to the project.
  • If you are using badges, add them here.

📒 Index

@mishudark
mishudark / .cursorrules
Created June 8, 2025 09:27 — forked from boxabirds/.cursorrules
Rock solid: turn Cursor into a rock-solid software engineering companion
# Project Policy
This policy provides a single, authoritative, and machine-readable source of truth for AI coding agents and humans, ensuring that all work is governed by clear, unambiguous rules and workflows. It aims to eliminate ambiguity, reduce supervision needs, and facilitate automation while maintaining accountability and compliance with best practices.
# 1. Introduction
> Rationale: Sets the context, actors, and compliance requirements for the policy, ensuring all participants understand their roles and responsibilities.
## 1.1 Actors