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
# Python file downloader for Pythonista by OMZ Software | |
# By: EJM Software ---- http://ejm.cloudvent.net | |
# Source: https://gist.github.com/89edf288a15fde45682a | |
# ***************************************** | |
# This simple script uses the requests module to download files | |
# and the ui module to show a progress bar | |
# You can use this bookmarklet to download files from Safari: | |
# javascript:window.location='pythonista://filedownloader?action=run&argv='+encodeURIComponent(document.location.href); | |
import ui, console, clipboard, sys, requests, zipfile |
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
# Source: https://gist.github.com/5212628 | |
# | |
# All-purpose gist tool for Pythonista. | |
# | |
# When run directly, this script sets up four other scripts that call various | |
# functions within this file. Each of these sub-scripts are meant for use as | |
# action menu items. They are: | |
# | |
# Set Gist ID.py - Set the gist id that the current file should be | |
# associated with. |
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
import ui | |
# Mapping based on http://www.upsidedowntext.com/unicode | |
CHARMAP = {'!': '\xc2\xa1', '"': ',,', | |
"'": ',', '&': '\xe2\x85\x8b', | |
')': '(', '(': ')', ',': "'", | |
'.': '\xcb\x99', | |
'1': '\xc6\x96', | |
'0': '0', '3': '\xc6\x90', | |
'2': '\xe1\x84\x85', |
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 __future__ import print_function, division | |
""" | |
By Willem Hengeveld <[email protected]> | |
ecdsa implementation in python | |
demonstrating several 'unconventional' calculations, | |
like finding a public key from a signature, | |
and finding a private key from 2 signatures with identical 'r' | |
""" |
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
#! /usr/bin/env python | |
""" | |
burn-btc: create a bitcoin burn address | |
By James C. Stroud | |
This program requries base58 (https://pypi.python.org/pypi/base58/0.2.1). | |
Call the program with a template burn address as the only argument:: |
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
""" | |
Bitcoin spray: distribute BTC from a coinbase.com account into many addresses | |
generated by a deterministic wallet (an electrum wallet). | |
1.0 BTC -> | |
0.01 BTC | |
0.01 BTC | |
0.01 BTC | |
etc.. |
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 __future__ import print_function, division | |
""" | |
Example of how calculations on the secp256k1 curve work. | |
secp256k1 is the name of the elliptic curve used by bitcoin | |
see http://bitcoin.stackexchange.com/questions/25382 | |
""" | |
## the prime modules used in the elliptic curve coordinate calculations | |
p = 2**256 - 2**32 - 977 |
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
_ =r"""A(W//2,*M(3*G | |
*G*V(2*J%P),G,J,G)+((M((J-T) | |
*V((G-S)%P),S,T,G)if(S@(G,J))if(W% | |
2@(S,T)))if(W@(S,T);H=2**256;import&hash | |
lib&as&h,os,re,binas cii&as&k;J$:int(k.b2 | |
a_hex(W),16);C$:C(W// 58) +[W%58]if(W@[];X | |
=h.new("ripemd1 60 ");Y$:h.sha256(W). | |
digest();I$d=32: I(W//256,d-1)+bytes | |
([W%256])if(d>0@b""; U$:J(k.a2b_base6 | |
4(W));f=J(os.urandom (64))% (H-U(b"AUVRIxlQ |
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
import urllib2 | |
import json | |
data = urllib2.urlopen("http://api.bitcoincharts.com/v1/weighted_prices.json") | |
def convert_to_bitcoin(amount, currency): | |
bitcoins = json.loads(data.read()) | |
converted = float(bitcoins[currency]["24h"]) * amount | |
print converted |
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
import urllib | |
import tarfile | |
import shutil | |
import console | |
import os | |
class Installer(object): | |
name = None | |
version = None | |
firstLetter = None |