Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
-module(xmltest). | |
-compile(export_all). | |
-include_lib("xmerl/include/xmerl.hrl"). | |
%% @doc Helper function to generate XML from a data structure and print it | |
serialize(Data) -> | |
Xml = lists:flatten(xmerl:export_simple(Data, xmerl_xml)), | |
io:format("~s~n", [Xml]). |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
import os | |
import asyncio | |
import sys | |
from asyncio.streams import StreamWriter, FlowControlMixin | |
reader, writer = None, None | |
@asyncio.coroutine | |
def stdio(loop=None): |
import asyncio | |
import tornado.concurrent | |
import tornado.ioloop | |
import tornado.web | |
import tornado.platform.asyncio | |
import tornado.httpclient | |
class ReqHandler(tornado.web.RequestHandler): | |
async def get(self): |
from sqlalchemy import func | |
from sqlalchemy.types import UserDefinedType, Float | |
class EasyGeometry(UserDefinedType): | |
def get_col_spec(self): | |
return "GEOMETRY" | |
def bind_expression(self, bindvalue): |
# Copyright (c) 2014 Andrey Vlasovskikh | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in |
# send yo to your devices via Yo API | |
# add next line to .bashrc/.zshrc to use this script | |
# export YO_APP="your justyo.co app token" | |
# USAGE: yop [link] | |
__yop(){ | |
local link=$1 | |
local api_url="http://api.justyo.co/yoall/" |
# send message to your devices via pushover.net API | |
# add next two or three lines to .bashrc/.zshrc to use this script | |
# export PUSHOVER_APP="your pushover.net app token" | |
# export PUSHOVER_USER="your pushover.net user key" | |
# # optional: | |
# export PUSHOVER_DEVICE="default device" | |
# USAGE: push <message> [-d=<device>] | |
# OPTIONS: |
func debounce( delay:NSTimeInterval, #queue:dispatch_queue_t, action: (()->()) ) -> ()->() { | |
var lastFireTime:dispatch_time_t = 0 | |
let dispatchDelay = Int64(delay * Double(NSEC_PER_SEC)) | |
return { | |
lastFireTime = dispatch_time(DISPATCH_TIME_NOW,0) | |
dispatch_after( | |
dispatch_time( | |
DISPATCH_TIME_NOW, |