Skip to content

Instantly share code, notes, and snippets.

View mythmon's full-sized avatar

Michael Cooper mythmon

View GitHub Profile
URxvt.background: black
URxvt.foreground: grey
URxvt.scrollBar: false
URxvt.cursorBlink: true
URxvt.imLocale: en_US.utf8
URxvt.termName: screen-256color-bce
URxvt.fading: 10
URxvt.saveLines: 40960
URxvt.visualBall: true
@mythmon
mythmon / trace
Created February 26, 2013 22:17
pdb doesn't work.
Traceback (most recent call last):
File "/home/mythmon/src/kitsune/vendor/src/django/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/mythmon/src/kitsune/vendor/src/django-mobility/mobility/decorators.py", line 23, in wrapper
return f(request, *args, **kw)
File "/home/mythmon/src/kitsune/vendor/src/django-session-csrf/session_csrf/__init__.py", line 127, in wrapper
response = f(request, *args, **kw)
File "/home/mythmon/src/kitsune/apps/questions/views.py", line 269, in answers
parse_troubleshooting(question))
File "/home/mythmon/src/kitsune/apps/questions/views.py", line 248, in parse_troubleshooting
Index: sl/LC_MESSAGES/javascript.po
===================================================================
--- sl/LC_MESSAGES/javascript.po (revision 113163)
+++ sl/LC_MESSAGES/javascript.po (working copy)
@@ -9,7 +9,7 @@
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=4; plural=(n%100==1. 0 : n%100==2. 1 : n%100==3 || n%100==4. 2 : 3);\n"
+"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
x = None
while x is None:
try:
x = int(input("Please enter a number: "))
except ValueError:
print("Oops! That was no valid number. Try again...")
@mythmon
mythmon / workflow.mkd
Last active December 12, 2015 04:49
A sketch for a software development work flow.

Problem statement

Sprints work pretty well, but they can get messy when contributors start being involved, or when bugs overflow the time boundaries of a sprint (ie a bug was started near the end of a sprint, and isn't finished at the end of the sprint). Sometimes sprints can feel like "mini waterfalls". On the other hand, sprints have the advantage of letting PMs easily define what work should be done, and helping this information flow from PMs to developers. They also help timebox projects, so that we can say "this will be done during this two week cycle. This predictability is important. Surprised estimations are teh suck. It isn't fair to ask a developer to make an estimate on something that they haven't worked on before without time to do some research.

Goals:

  • Reduce dependency on a fixed two week cycle.
  • Maintain a level of predictability, within the error margins of estimation.
  • Keep the amount of metawork to a minimum.
  • Reduce the amount of "surprise estimations".
@mythmon
mythmon / gist:4710376
Created February 4, 2013 22:36
I think I can't filter by null.
(InteractiveConsole)
>>> from questions.models import Question
>>> Question.search().values_dict()[0]
{u'product': [u'firefox'], u'updated': 1356126726, u'question_num_answers': 0, u'question_is_solved': False, u'question_has_answers': False, u'question_is_locked': True, u'topic': [u'websites'], u'question_tag': [u'Firefox 17.0', u'websites', u'desktop', u'Windows XP'], u'id': 944987, u'question_has_helpful': False, u'question_locale': None, u'created': 1356126726, u'url': u'/questions/944987', u'question_title': u'Jquery? One of the most used Java Scripts, Causing major problems.', u'question_content': u'<SNIP>', u'question_num_votes_past_week': 0, u'question_answer_creator': [], u'question_answer_content': [], u'question_creator': u'ProfNeal', u'model': u'questions_question', u'question_num_votes': 1, u'indexed_on': 1360015129}
>>> print _['question_locale']
None
>>> Question.search().filter(question_locale=None).values_dict()[0]
@mythmon
mythmon / wat.js
Created December 28, 2012 23:54
This only prints "-1", and then "It works.". Then nothing else.
$.ajax({
type: 'POST',
url: $form.prop('action'),
data: $form.serialize(),
dataType: 'json',
success: function(data) {
console.log('-1');
console.log('It worked.');
console.log('0');
$form.find('textarea').value('');
@mythmon
mythmon / gist:4253776
Created December 10, 2012 22:04
Demonstration of headers in the Github status API that prevents in browser use.
$ http HEAD "https://status.github.com/api/messages.json?callback=apiCallback"
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 13
Content-Type: application/javascript;charset=utf-8
Date: Mon, 10 Dec 2012 22:04:03 GMT
Server: nginx
Status: 200 OK
X-Frame-Options: sameorigin
X-XSS-Protection: 1; mode=block
$('.card-grid').each(function() {
var $cards = $(this).children('li');
var max = 0;
$cards.each(function() {
var h = $(this).height();
if (h > max) {
max = h;
}
});
$cards.height(max);
HTTP/1.1 200 OK
Age: 164
Content-Disposition: inline; filename=6a00d8341c858253ef00e54f6a9ac38833-640wi.gif
Content-Type: image/gif
Date: Thu, 06 Dec 2012 23:37:59 GMT
Expires: Fri, 07 Dec 2012 03:35:15 GMT
Keep-Alive: timeout=300, max=100
Last-Modified: Mon, 10 Mar 2008 01:57:42 GMT
Server: Apache
Vary: cookie