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| /* | |
| * This is a litle tech demo to demonstrate using clojureCLR in a CLR web app. | |
| * | |
| * A custom IHttpHandler (ClojureHttpHandler) handles invocation of clojure code, | |
| * and a custom IRouteHandler (ClojureRouteHandler) routes requests to the HttpHandler. | |
| * | |
| * See comments in the code for further detail. | |
| * | |
| * Cheers, zdam | |
| * http://zimpler.com/blog/clojureclr-in-an-asp-net-mvc-app |
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| # The Nginx configuration based on https://coderwall.com/p/rlguog | |
| http { | |
| ssl_certificate server.crt; | |
| ssl_certificate_key server.key; | |
| ssl_session_timeout 15m; | |
| ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; | |
| ssl_prefer_server_ciphers on; | |
| ssl_session_cache shared:SSL:10m; |
| <?xml version="1.0" encoding="utf-8"?> | |
| <Project DefaultTargets="PrepareStaticContent" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
| <PropertyGroup> | |
| <!-- Passed in Parameters --> | |
| <configuration></configuration> | |
| <workingDir></workingDir> | |
| <buildNumber></buildNumber> | |
| <buildViews>false</buildViews> | |
| <minifyJs>true</minifyJs> | |
| <TargetsDirectory></TargetsDirectory> |
A quick guide to write a very very simple "ECHO" style module to redis and load it. It's not really useful of course, but the idea is to illustrate how little boilerplate it takes.
Step 1: open your favorite editor and write/paste the following code in a file called module.c
#include "redismodule.h"
/* ECHO <string> - Echo back a string sent from the client */
int EchoCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {Long ago, the first time I read "The Pragmatic Programmer", I read some advice that really stuck with me.
"Don't Use Manual Procedures".
This in the chapter on Ubiquitous Automation. To summarize, they want you to automate all the things.
The trouble was that I hadn't much of an idea how to actually go
| sealed abstract class Tree[A] | |
| case class Item[A] (item: A) extends Tree[A] | |
| case class Section[A] (s: List[Tree[A]]) extends Tree[A] | |
| sealed abstract class Path[A] | |
| case class Top[A] extends Path[A] | |
| case class Node[A] (l: List[Tree[A]], p: Path[A], r: List[Tree[A]]) extends Path[A] | |
| case class Location[A] (t: Tree[A], p: Path[A]) |
If you have two days to learn the very basics of modelling, Domain-Driven Design, CQRS and Event Sourcing, here's what you should do:
In the evenings read the [Domain-Driven Design Quickly Minibook]{http://www.infoq.com/minibooks/domain-driven-design-quickly}. During the day watch following great videos (in this order):
| import falcon | |
| import os | |
| from app.db import db_session | |
| from app.utils.exceptions import build_error_response | |
| from app.startup import (autoload, add_routes) | |
| wsgi_app = falcon.API(after=[db_session.remove_session]) | |
| autoload("{0}/{1}".format(os.path.dirname(__file__), "handlers")) |
| defmodule MyApp.Scheduler do | |
| @moduledoc """ | |
| Schedules a Mix task to be run at a given interval in milliseconds. | |
| ## Options | |
| - `:task`: The name of the Mix task to run. | |
| - `:args`: A list of arguments to pass to the Mix task's `run/1` function. | |
| - `:interval`: The time interval in millisconds to rerun the task. |