Skip to content

Instantly share code, notes, and snippets.

View ojii's full-sized avatar

Jonas Obrist ojii

View GitHub Profile
@ojii
ojii / please-include-a-repro.md
Last active January 24, 2023 00:01 — forked from Rich-Harris/please-include-a-repro.md
Please include a repro

Please include a repro

You probably arrived here because of a curt message in response to an issue you filed on a repo that I contribute to. Sorry about that (particularly if you filed the issue long ago and have been waiting patiently for a response). Let me explain:

I work on a lot of different open source projects. I really do like building software that makes other people's lives easier, but it's crazy time-consuming. One of the most time-consuming parts is responding to issues. A lot of OSS maintainers will bend over backwards to try and understand your specific problem and diagnose it, to the point of setting up new test projects, fussing around with different Python versions, reading the documentation for build tools that we don't use, debugging problems in third party dependencies that appear to be involved in the problem... and so on. I've personally spent hundreds of hours of my free time doing these sorts of things to try and help people out, because I want to be a responsible maintainer and

@ojii
ojii / attack.py
Created October 12, 2012 23:40 — forked from FugiTech/attack.py
txircd load testing script using BeesWithMachineGuns (long-term join/quit test)
# -*- coding: utf-8 -*-
from twisted.internet import reactor, ssl
from twisted.internet.protocol import ClientFactory
from twisted.words.protocols.irc import IRCClient
import random, string
ATTACK, STANDBY = 0,1
QUIT_CHANCE = 10#%
JOIN_CHANCE = 80#%
@ojii
ojii / choices.py
Created August 14, 2012 15:53 — forked from beniwohli/choices.py
# modified version of http://tomforb.es/using-python-metaclasses-to-make-awesome-django-model-field-choices
# that preserves order of definition
import itertools
class Option(object):
_counter = itertools.count()
def __init__(self, value, verbose_name=None):
self._count = Option._counter.next()
self.value = value
@ojii
ojii / gist:1869970
Created February 20, 2012 16:20
Create free Clickmap account
URI, POST
/api/account/register
data = {
'username': '...',
'password': '...',
'email': '...', # optional
}
@ojii
ojii / gist:1510632
Created December 22, 2011 15:11 — forked from crooksey/gist:1510607
from django.db import models
from polymorphic.polymorphic_model import PolymorphicModel
from cms.models.fields import PlaceholderField
from django.db.models.signals import pre_save
from django.template.defaultfilters import slugify
class Slugifier(object):
def __init__(self, model, target, source):
self.model = product
self.target = slug
@ojii
ojii / gist:1328081
Created October 31, 2011 17:29 — forked from evildmp/gist:1328038
Attempt to understand the menu system
=========================
How the menu system works
=========================
Basic concepts
==============
Registration
------------
@ojii
ojii / isthestoreopen.py
Created July 20, 2011 13:27
Is the Apple store open? (Linux User Version)
import requests
import time
store_open = False
while not store_open:
response = requests.get('http://store.apple.com/')
if "We'll be back soon" not in response.content:
break
print "Meh."
from django.conf import settings
from django.utils.translation import string_concat, ugettext_lazy
from django.utils.html import strip_tags
from haystack import indexes, site
from cms.models.managers import PageManager
from cms.models.pagemodel import Page
from cms.models.pluginmodel import CMSPlugin
<html>
<head>
<script ... my global script></script>
{% renderblock myhead %}
other stuf
{% renderblock myhead2 %}
</head>
<body>
<div id="page">
{% addtoblock myhead %}
In [1]: from simplegallery import models as sg
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
/Users/stefanfoulis/Documents/Coding/Workspaces/Main/affichage/<ipython console> in <module>()
/Users/stefanfoulis/Documents/Coding/Workspaces/Main/django-simplegallery/simplegallery/models.py in <module>()
6 from cms.models import Page
7 from cms.models import CMSPlugin
----> 8 from cms.models.fields import PageField