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
| pragma solidity ^0.4.0; | |
| contract Ballot { | |
| struct Voter { | |
| uint weight; | |
| bool voted; | |
| uint8 vote; | |
| address delegate; | |
| } | |
| struct Proposal { |
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
| pragma solidity ^0.4.0; | |
| contract Ballot { | |
| struct Voter { | |
| uint weight; | |
| bool voted; | |
| uint8 vote; | |
| address delegate; | |
| } | |
| struct Proposal { |
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
| https://press.one/p/address/v?s=a5f02c2979981c7c560c758f631234a9f35121e9e79149a2071d0700e0c360ba4483851872375873a9b5f9138b5973066c641bd8c58a72c38b46f60a770c0d3a0&h=436a3ddf95ac02c52932c1233118c55971dc134bd2ca422dcf241670419ff40f&a=7e32e3deba87efcd35bc6d1ab355d85c50aa60bd&f=P1&v=2 |
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
| #!/bin/bash | |
| # References | |
| # http://www.computerhope.com/unix/nc.htm#03 | |
| # https://github.com/daniloegea/netcat | |
| # http://unix.stackexchange.com/questions/26715/how-can-i-communicate-with-a-unix-domain-socket-via-the-shell-on-debian-squeeze | |
| # http://unix.stackexchange.com/questions/33924/write-inside-a-socket-open-by-another-process-in-linux/33982#33982 | |
| # http://www.linuxjournal.com/content/more-using-bashs-built-devtcp-file-tcpip | |
| # http://www.dest-unreach.org/socat/ | |
| # http://stuff.mit.edu/afs/sipb/machine/penguin-lust/src/socat-1.7.1.2/EXAMPLES |
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 subprocess | |
| def check_output(args, stderr=None): | |
| '''Run a command and capture its output''' | |
| return subprocess.Popen(args, stdout=subprocess.PIPE, | |
| stderr=stderr).communicate()[0] | |
| if __name__ == '__main__': | |
| check_output(['df', '-h']) | |
| check_output(['df', '-h'], stderr=subprocess.STDOUT) |
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
| #!/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import xml.etree.ElementTree as ET | |
| class CommentedTreeBuilder(ET.XMLTreeBuilder): | |
| def __init__(self, html = 0, target = None): | |
| ET.XMLTreeBuilder.__init__(self, html, target) | |
| self._parser.CommentHandler = self.handle_comment |
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
| #!/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| --A| | |
| |-a.pack | |
| |-aa.pack | |
| |-B| | |
| |-b.pack | |
| |-b.pack |
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 npyscreen, curses | |
| class StatusWidget(npyscreen.wgwidget.Widget): | |
| def update(self, clear=True): | |
| if clear == True: | |
| self.clear() | |
| self.status = npyscreen.Textfield(self.parent, rely=self.rely, relx=0, editable=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 npyscreen | |
| from datetime import datetime | |
| class DateForm(npyscreen.Form): | |
| def while_waiting(self): | |
| npyscreen.notify_wait("Update") | |
| self.display() | |
| def create(self): | |
| self.add(npyscreen.FixedText, value=datetime.now(), editable=False) |
NewerOlder