Skip to content

Instantly share code, notes, and snippets.

View viktor-evdokimov's full-sized avatar
👷‍♂️
Focusing

Viktor Evdokimov viktor-evdokimov

👷‍♂️
Focusing
View GitHub Profile
@viktor-evdokimov
viktor-evdokimov / zipper.scala
Last active October 19, 2016 14:26 — forked from hoheinzollern/zipper.scala
Zipper scala implementation
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])
@viktor-evdokimov
viktor-evdokimov / automation.md
Created June 17, 2016 04:57 — forked from cube-drone/automation.md
Automation For The People

Automation for the People

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

Creating a redis Module in 15 lines of code!

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) {
@viktor-evdokimov
viktor-evdokimov / Build.xml
Created May 8, 2016 07:08 — forked from NickCraver/Build.xml
Stack Overflow Build Reference Docs
<?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>
@viktor-evdokimov
viktor-evdokimov / gist:bc6c4287904dea3e81803e2a35a7231b
Created April 11, 2016 14:27 — forked from mikhailov/gist:9639593
Nginx S3/Unicorn Proxy with backend keep alive
# 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;
@viktor-evdokimov
viktor-evdokimov / web-servers.md
Created February 13, 2016 07:55 — forked from willurd/web-servers.md
Big list of http static server one-liners

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.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@viktor-evdokimov
viktor-evdokimov / clojure-clr-webserver.cs
Created October 22, 2015 17:50 — forked from zdam/clojure-clr-webserver.cs
Use clojureCLR inside an asp.net MVC app
/*
* 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
@viktor-evdokimov
viktor-evdokimov / nginx.conf
Created October 7, 2015 01:53 — forked from timmyomahony/nginx.conf
Python, UWSGI, Supervisor & Nginx
upstream uwsgi {
ip_hash;
server 127.0.0.1:40000;
}
server {
listen 80;
server_name www.domain.com;
root /sites/mysite/;
access_log /sites/mysite/log/nginx/access.log;
@viktor-evdokimov
viktor-evdokimov / example
Last active August 29, 2015 14:25 — forked from koreno/README.md
'rebaser' improves on 'git rebase -i' by adding information per commit regarding which files it touched.
pick d0d13d0 1:removed some bullshit from __entrypoint.d _________9______
pick a44e878 2:Improvements to object.d and __entrypoint.d ________89______
pick 12c5b47 3:Add usage to build.d ___3____________
pick 318af43 4:Added .gitignore ______________e_
pick eb9ad0f 5:Attempting to add more array support _1_3_56_89abcd__
pick 8b8df05 6:Added some special support for ldc to object.d ________8_______
pick e630300 7:Removed imports from build ___3____________
pick 69ae673 8:c-main to d-main __2345_7_9______
pick c00b344 9:Implemented write an exit system calls _1_345678_______
pick 3901cca 10:Add wscript_build file 0__3____________
@viktor-evdokimov
viktor-evdokimov / pipeHook.js
Last active August 29, 2015 14:24 — forked from Marak/pipeHook.js
Pipe Hooks into each other
module['exports'] = function pipeHook (hook) {
hook.debug('Opening echo hook with some data');
var hook2 = hook.open('http://hook.io/Marak/echo?foo=bar');
hook2.write('hello!');
hook2.pipe(hook.res);
};