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 comParsing(): | |
| global comDist,n,nodeCoordinates | |
| n = int(graph.split('\n')[0].split()) | |
| for i in graph.split('\n')[1:]: | |
| nodeCoordinates.append((int(i.split()[0]), int(i.split()[1]))) | |
| for i,index in zip(nodeCoordinates,range(n)): | |
| for j,index2 in zip(nodeCoordinates,range(n)): | |
| comDist[index][index2]=math.sqrt((nodeCoordinates[j][0]-nodeCoordinates[i][0])**2+(nodeCoordinates[j][1]-nodeCoordinates[i][1])**2) #rasstoyanie ot i do vseh j | |
| def commivoyager(): |
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
| #!/usr/bin/env python | |
| """ | |
| Embed files into C arrays | |
| Hacky solution because xxd didn't have enough features | |
| """ | |
| from __future__ import with_statement | |
| from __future__ import print_function |
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 extend_instance(instance, *bases, **kwargs): | |
| """ | |
| Apply subclass (mixin) to a class object or its instance | |
| By default, the mixin is placed at the start of bases | |
| to ensure its called first as per MRO. If you wish to | |
| have it injected last, which is useful for monkeypatching, | |
| then you can specify 'last=True'. See here: | |
| http://stackoverflow.com/a/10018792/1267398 | |
| :attr cls: Target object |
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
| for k in ['host', 'port', 'database', 'user', 'password']: | |
| if k in dbconfig: | |
| if type(dbconfig[k]) in (str, unicode): | |
| match = pat.match(dbconfig[k]) | |
| if match and match.groups(): | |
| envvar = match.groups()[0] | |
| if envvar in os.environ: | |
| dbconfig[k] = os.environ[envvar] | |
| if k != 'password': |
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 extend_instance(instance, *bases, **kwargs): | |
| """ | |
| Apply subclass (mixin) to a class object or its instance | |
| By default, the mixin is placed at the start of bases | |
| to ensure its called first as per MRO. If you wish to | |
| have it injected last, which is useful for monkeypatching, | |
| then you can specify 'last=True'. See here: | |
| http://stackoverflow.com/a/10018792/1267398 |
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 os | |
| import sys | |
| import subprocess | |
| def sanitypatch(): | |
| """ | |
| Quick hack to install any package we want in coderpad... | |
| Because real coders use pytest, amirite? | |
| """ | |
| print("applying coderpad sanity patch...") |
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
| Dear Zendesk, | |
| On behalf of the internet, and for the greater good of mankind, this is a request to | |
| politely ask you to change the default theme of your support emails. | |
| Currently every support email notification, for the majority of your customers, | |
| includes a complete dump of the entire conversation. And due to the way you | |
| have constructed the HTML in your email, most email clients fail to realise | |
| it is duplicated text and do not remove it. |
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
| <!-- BEM EXAMPLE --> | |
| <style> | |
| .btn { display: block; color: red; } | |
| .btn--orange { color: orange; } | |
| </style> | |
| <div class="btn btn--orange"></div> | |
| <!-- NON-BEM EXAMPLE --> | |
| <style> |
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
| (function() { | |
| var fs = require('fs'); | |
| var path = require('path'); | |
| var current_dir = path.dirname(fs.realpathSync(__filename)); | |
| var design_docs_dir = path.join(current_dir, 'design_docs'); | |
| var files = fs.readdirSync(design_docs_dir); | |
| var json = {}; | |
| files.forEach(function(fpath) { |
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
| ==Phrack Inc.== | |
| Volume One, Issue 7, Phile 3 of 10 | |
| =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | |
| The following was written shortly after my arrest... | |
| \/\The Conscience of a Hacker/\/ | |
| by |