This file contains 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
cp original.pdf bak.pdf | |
gs -o original.pdf -sDEVICE=pdfwrite bak.pdf |
This file contains 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 remove_extra_newlines(input_str, newlines_left=3): | |
number_of_newlines = input_str.count('\n') | |
if number_of_newlines > newlines_left: | |
amount_to_strip = number_of_newlines - newlines_left | |
return input_str[::-1].replace('\n', ' ', amount_to_strip)[::-1] | |
else: | |
return input_str |
This file contains 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
HyperFido - FIDO U2F Security Key | |
By Jonathan Williams | |
https://www.amazon.com/review/R1MX4254RVC97T/ref=cm_cr_dp_cmt?ie=UTF8&ASIN=B00WIX4JMC&channel=detail-glance&nodeID=541966&store=pc#wasThisHelpful | |
This HyperFIDO U2F key is small enough to keep in your pocket or purse at all times and never worry about it. It worked great after getting a fast reply from HyperSECU support about the linux udev rules needed (I don't use windows). I had it set up very quickly with Google services and it worked flawlessly. Hopefully, more services will support U2F in the future. | |
If you are wondering, here are the udev rules their awesome support recommended. I created a file /etc/udev/rules.d/96-hyperfido.rules and used the first example below because thankfully, I do not have to deal with systemd. If you are unfortunate enough to have to use systemd, please use the second example. | |
Example 1 |
This file contains 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
from ethereum.slogging import configure_logging | |
configure_logging(':trace') |
This file contains 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
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" XF86AudioPlay | |
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop" XF86AudioStop | |
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" XF86AudioNext | |
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" XF86AudioPrevious | |
This file contains 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
from ethereum.tools import tester | |
from vyper import compiler | |
def test_merkle_proof_contract(): | |
tester.languages['vyper'] = compiler.Compiler() | |
s = tester.Chain() # initialize test chain | |
contract_code = open('merkleproof.v.py').read() # get source code | |
contract = s.contract(contract_code, language='vyper') # compile code |
This file contains 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 debug_opcode(computation): | |
print('YOUR ARE HERE!') | |
import ipdb; ipdb.set_trace() | |
import evm | |
from evm.vm.opcode import as_opcode | |
from vyper.opcodes import opcodes as vyper_opcodes | |
from evm.vm.forks.byzantium.computation import ByzantiumComputation | |
opcodes = ByzantiumComputation.opcodes.copy() |
This file contains 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
# Module for codegen. Currently most codegen lives in | |
# parser/parser_utils.py and can slowly be migrated here as | |
# type-checking code gets factored out. | |
from vyper.exceptions import ( | |
InvalidLiteralException, | |
TypeMismatchException, | |
StructureException | |
) | |
from vyper.types import ( |
This file contains 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
[seq, | |
[return, | |
0, | |
[lll, | |
[seq, | |
[mstore, 28, [calldataload, 0]], | |
[mstore, 32, 1461501637330902918203684832716283019655932542976], | |
[mstore, 64, 170141183460469231731687303715884105727], | |
[mstore, 96, -170141183460469231731687303715884105728], | |
[mstore, 128, 1701411834604692317316873037158841057270000000000], |
This file contains 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
_______________________________________________________________ test_struct_return_abi ________________________________________________________________ | |
data_type = '(int128,bool)', data_value = (1, True) | |
def abi_sub_tree(data_type, data_value): | |
if data_type is None: | |
return ABITypedData([None, data_value]) | |
try: | |
> base, sub, arrlist = data_type |