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
<?php | |
$fiLi = glob("/home/tim/Desktop/test/*.pdf"); | |
while(true) | |
{ | |
$i = array_rand($fiLi); | |
if(!file_exists($fiLi[$i])) | |
throw RuntimeError("File said not to exist"); | |
} |
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
#Funky seamless texture generator | |
#By Tim Sheerman-Chase (c) 2018 | |
#Released under CC0 license | |
from __future__ import print_function | |
from PIL import Image | |
import argparse | |
if __name__=="__main__": |
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
//simple msgpack-rpc server, based on Boost ASIO | |
//Based on http://www.boost.org/doc/libs/1_35_0/doc/html/boost_asio/tutorial/tutdaytime3/src.html | |
//msgpack-rpc based on https://github.com/msgpack-rpc/msgpack-rpc/blob/master/spec.md | |
//Build with: g++ -std=c++11 server.cpp -lboost_system -o server | |
#include <iostream> | |
#include <string> | |
#include <boost/bind.hpp> | |
#include <boost/shared_ptr.hpp> | |
#include <boost/enable_shared_from_this.hpp> |
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 __future__ import print_function | |
import os | |
from scipy.misc import imread, imsave | |
import numpy as np | |
if __name__=="__main__": | |
total = None | |
fiLi = os.listdir(".") |
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
<?php | |
// User API usage in OpenCart 3.0.2.0 | |
// http://sv2109.com/en/article/opencart-api-system | |
// Patches from https://forum.opencart.com/viewtopic.php?t=186063 need to be applied to 3.0.2.0 | |
$apiKey = "foobar34y3yl34myl3erwhyl34yl3k4ynpwgen"; //Whatever you put in System -> Users -> API |
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 __future__ import print_function | |
import sys | |
import requests | |
from requests.auth import HTTPBasicAuth | |
import xml.etree.ElementTree as ET | |
PY3 = sys.version_info > (3, 0) | |
if PY3: | |
raw_input = input | |
def GetChangesetBbox(cid): |
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
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
from __future__ import print_function | |
import struct | |
def CheckUcs2BEIsValid(e, big_endian=True): | |
#UCS-2 is a fixed width encoding. Therefore, check that the | |
#variable width aspect of UTF-16 is not used. | |
if big_endian: | |
struct_code = ">H" |
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
# The code is placed into public domain by anatoly techtonik | |
# Feel free to copy/paste wherever you like | |
# Absolutely minimal example of PySide2 application with window | |
from PySide2 import QtGui, QtWidgets | |
# Get entrypoint through which we control underlying Qt framework | |
app = QtWidgets.QApplication([]) |
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 os | |
import shapefile | |
from shapely.geometry import Polygon | |
if __name__ == "__main__": | |
sf = shapefile.Reader("TM_WORLD_BORDERS-0.3.shp") | |
assert len(sf.shapes()) == len(sf.records()) | |
fieldIndex = {} |
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 xml.etree.ElementTree as ET | |
import dateutil.parser | |
from datetime import timedelta | |
class Interpolate(object): | |
def __init__(self, knownWpts): | |
self.knownWpts = knownWpts[:] | |
self.knownWpts.sort() | |
#for wpt in self.knownWpts: |