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.ext.sqlalchemy import SQLAlchemy | |
from flask.ext.wtf import Form | |
from flask.ext.babel import gettext | |
from wtforms import SelectField, TelField, TextField, FormField, Fieldlist, SubmitField | |
from wtforms.validators import Optional, Required | |
app = Flask(__name__) | |
db = SQLAlchemy(app) |
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
; remove all parameters | |
M8513 | |
; [[The text after the semicolon is a comment, please modify the corresponding parameters according to the description of the comment, the command after the semicolon will be ignored]] | |
; The basic format is Mxxx Ixxx, Mxxx Txxx or Mxxx Sxxx, where Ixx (is the letter I, the first letter of integer, not the number 1) followed by an integer, which can be decimal or hexadecimal (starting with 0x) , Pxx, Sxx are followed by floating point numbers | |
; [Direction control of stepper motor] The directions of I1 and I-1 are just opposite, so if the direction of the motor is wrong, either change the wiring or change this direction parameter | |
; Z stepper motor direction | |
M8004 I1 |
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
button.DialogButton{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;border:0;font:inherit;overflow:visible;padding:0;margin:2px 0;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;display:block;line-height:32px;color:#dfe3e6;font-size:14px;text-align:center;border-radius:2px;cursor:pointer;width:100%;transition:all .2s ease-out;background:#3d4450;background-position:99% 1%;background-size:300% 300%;position:relative}input.DialogInput::-moz-focus-inner,button.DialogButton::-moz-focus-inner{border:0;padding:0}.DialogInputPlaceholder::placeholder,.DialogInputPlaceholder::-webkit-input-placeholder{color:#969696;font-style:italic}.DialogInputPlaceholder::-ms-input-placeholder,.DialogInputPlaceholder:-ms-input-placeholder{color:#969696;font-style:italic}.PopupFullWindow{height:100%}.FullModalOverlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1500}.FullModalOverlay.NotReadyToRender{background:#000}.FullModalOverlay .ModalPosition_Content{ |
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
// ==UserScript== | |
// @name Thingiverse Zip Button | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://www.thingiverse.com/thing:* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=thingiverse.com | |
// @grant none | |
// ==/UserScript== |
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 re | |
ALLOWED_TYPES = {"comment", "reply", "unsub", "sub"} | |
class RegexBuilder: | |
def __init__(self, *parts): | |
self._parts = [] | |
if parts: | |
self.add(*parts) |
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
var async = require("async"); | |
var AWS = require("aws-sdk"); | |
var gm = require("gm").subClass({imageMagick: true}); | |
var fs = require("fs"); | |
var mktemp = require("mktemp"); | |
var THUMB_KEY_PREFIX = "thumbnails/", | |
THUMB_WIDTH = 150, | |
THUMB_HEIGHT = 150, | |
ALLOWED_FILETYPES = ['png', 'jpg', 'jpeg', 'bmp', 'tiff', 'pdf', 'gif']; |
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 sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy import Integer, Column | |
from postgresql_json import JSON | |
Base = declarative_base() | |
class Document(Base): | |
id = Column(Integer(), primary_key=True) | |
data = Column(JSON) | |
#do whatever other work |
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 ctypes | |
kernel32 = ctypes.windll.kernel32 | |
CreateFileW = kernel32.CreateFileW | |
CloseHandle = kernel32.CloseHandle | |
CreateFileW.__doc__ = """HANDLE WINAPI CreateFile( | |
_In_ LPCTSTR lpFileName, | |
_In_ DWORD dwDesiredAccess, | |
_In_ DWORD dwShareMode, |
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]] | |
url = "https://pypi.python.org/simple" | |
verify_ssl = true | |
name = "pypi" | |
[packages] | |
flask = "*" | |
sqlalchemy = "*" | |
[dev-packages] |
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 html | |
from markupsafe import Markup | |
class InvalidVoidTag(Exception): | |
pass | |
VOID_TAGS = { |
NewerOlder