This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| common_cols_pretty = """dtLastUpdated | |
| dtOpened | |
| dtResolved | |
| dtClosed | |
| sTitle | |
| sStatus | |
| ixStatus | |
| sEmailAssignedTo | |
| sPersonAssignedTo""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Person(object): | |
| @property | |
| def fullname(self): | |
| return "%s - %s" % (self.forename, self.surname) | |
| @fullname.setter | |
| def fullname(self, value): | |
| self.forename, self.surname = value.split(" ", 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import inspect | |
| frame,filename,line_number,function_name,lines,index=\ | |
| inspect.getouterframes(inspect.currentframe())[1] | |
| print(frame,filename,line_number,function_name,lines,index) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http://stackoverflow.com/questions/4652559/in-javascript-is-their-a-way-to-inspect-an-objects-methods-and-attributes-such-a | |
| (1) | |
| var dir = ''; | |
| for (var i in obj) dir += 'obj[' + i + '] = ' + obj[i]; | |
| alert(dir); | |
| http://stackoverflow.com/questions/5357442/how-to-inspect-javascript-objects |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def _buttons_js(results): | |
| """ Adds the 'click' handler to all the 'add to cart' buttons """ | |
| t4 = Template("""$('#cart-{{product_group}}-{{oldid}}').live('click', function(event) { | |
| article_id = get_article_id( '{{product_group}}', '{{oldid}}' ); | |
| $(this).attr('disabled', true); | |
| publish_message( '{{product_group}}', '{{oldid}}', 'Added ' + article_id + ' !' ); | |
| }); | |
| """) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SET foreign_key_checks = 0; | |
| SET foreign_key_checks = 1; | |
| To check the status after/before the change: | |
| mysql> show variables; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Originally: | |
| https://gist.github.com/7565976a89d5da1511ce | |
| Hi Donald (and Martin), | |
| Thanks for pinging me; it's nice to know Typesafe is keeping tabs on this, and I | |
| appreciate the tone. This is a Yegge-long response, but given that you and | |
| Martin are the two people best-situated to do anything about this, I'd rather | |
| err on the side of giving you too much to think about. I realize I'm being very | |
| critical of something in which you've invested a great deal (both financially |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class A(object): | |
| a = 1 | |
| b = 2 + a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ExpiryFilterSpec(ChoicesFilterSpec): | |
| def __init__(self, f, request, params, model, model_admin, | |
| field_path=None): | |
| super(ExpiryFilterSpec, self).__init__(f, request, params, model, | |
| model_admin, | |
| field_path=field_path) | |
| self.field_generic = '%s__' % self.field_path | |
| self.field_generic_not = 'not_' + self.field_generic |