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/python | |
| import subprocess, time, os | |
| def run_command(command): | |
| p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | |
| output = p.communicate()[0] | |
| return output[:-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
| <html> | |
| <head> | |
| <style> | |
| #my_canvas { | |
| border:3px solid #333; | |
| background-color: rgb(39, 93, 140); | |
| border-radius: 250px; | |
| width:25; | |
| webkit-filter: grayscale(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
| #!/usr/bin/python | |
| from multiprocessing import Pool | |
| import time | |
| import urllib | |
| start = time.time() | |
| urls = [ | |
| "https://docs.python.org/2/library/urllib.html", | |
| "http://www.nytimes.com", |
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
| from bottle import route, run, response, request | |
| import sys, os, time, json | |
| # CONVERT DICTONARY TO JSON | |
| def dict_to_json(dict_data,return_type='pretty'): | |
| if return_type == 'pretty': | |
| return json.dumps(dict_data, sort_keys=True,indent=4, separators=(',', ': ')) | |
| elif return_type == 'raw': | |
| return json.dumps(dict_data) |
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/python | |
| import time, sys, json | |
| import mclevel | |
| def block_dict(): | |
| with open("pymclevel/blocks.json") as f: | |
| return json.load(f) | |
| def load_world_data(world_path): |
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
| [ | |
| [0, 0, "air"], | |
| [1, 0, "stone"], | |
| [1, 1, "granite"], | |
| [1, 2, "polished granite"], | |
| [1, 3, "diorite"], | |
| [1, 4, "polished diorite"], | |
| [1, 5, "andesite"], | |
| [1, 6, "polished andesite"], | |
| [2, 0, "grass"], |
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/sh | |
| date_and_time=`date` | |
| input_file=${1} | |
| output_file=${2} | |
| start_second=5 | |
| stop_second=25 | |
| framerate_in=`mediainfo -i ${input_file} | grep "Frame rate " | awk -F " " {'print $4'}` |
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 customSignFilter(poi): | |
| import re | |
| if poi['id'] == 'Sign': | |
| text_list = [poi['Text1'], poi['Text2'], poi['Text3'], poi['Text4']] | |
| tag = None | |
| for i in range(0,len(text_list)): | |
| if text_list[i].find("#") > -1: | |
| text_trunc = text_list[i][text_list[i].find("#"):len(text_list[i])] | |
| if text_trunc.find(" ") > -1: | |
| tag = str(text_trunc[1:text_trunc.find(" ")]).lower() |
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 psutil, os, json | |
| def get_folders(path): | |
| if os.access(path, os.X_OK) == True: | |
| files_and_folders = os.listdir(path) | |
| folders = [] | |
| for f in files_and_folders: | |
| if f[0] not in ['.','~']: | |
| full_path = path+'/'+f | |
| if os.path.isdir(full_path) == True: |