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
function transformer (ast) { | |
var svg_ast = { | |
tag : 'svg', | |
attr: { | |
width: 100, height: 100, viewBox: '0 0 100 100', | |
xmlns: 'http://www.w3.org/2000/svg', version: '1.1' | |
}, | |
body:[] | |
} | |
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 flask import Flask | |
from flask import request | |
import json | |
import requests | |
import hashlib as hasher | |
import datetime as date | |
node = Flask(__name__) | |
# Define what a Snakecoin block is | |
class Block: |
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 hashlib as hasher | |
import datetime as date | |
# Define what a Snakecoin block is | |
class Block: | |
def __init__(self, index, timestamp, data, previous_hash): | |
self.index = index | |
self.timestamp = timestamp | |
self.data = data | |
self.previous_hash = previous_hash |
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 library | |
import json | |
# This is a python library for 'Text Processing Services', as the offcial site suggests. | |
import difflib | |
from difflib import SequenceMatcher | |
#Let's load the same data again | |
data = json.load(open("dictionary.json")) | |
#Run a Sequence Matcher |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
""" | |
Placed into public domain by | |
anatoly techtonik <techtonik@gmail.com> | |
Show HTML in GUI window through PyQt4/PySide. | |
[ ] position window at the center of the screen | |
(right now it is middle bottom) | |
[ ] implement lazy loading for PyQt4/PySide | |
""" |
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 ast | |
import os | |
stats = { | |
'funcs':0, | |
'classes':0, | |
'analysed':0 | |
} | |
base_path = 'C:\\Python37-32\\Lib' |
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
# using rich console | |
def ensure_internet(): | |
console = Console() | |
domains = [ | |
'https://google.com', | |
'https://yahoo.com', | |
'https://bing.com', | |
'https://www.ecosia.org', | |
'https://www.wikipedia.org' |
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 isbalanced(string): | |
stack = [] | |
for char in string: | |
if char == '(': | |
stack.append(char) | |
elif char == ')': | |
if not stack: # stack empty trying to remove | |
return False | |
else: | |
stack.pop() |
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 identify_symbols(string): | |
elements = [] | |
num_stack = [] # holds numbers | |
index = 0 | |
while index < len(string): | |
char = string[index] | |
if char in '+-/*()': | |
# Add number to elements | |
if num_stack: |
OlderNewer