Skip to content

Instantly share code, notes, and snippets.

View juev's full-sized avatar
🏠
Working from home

Evsyukov Denis juev

🏠
Working from home
View GitHub Profile
#!/bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
#define _CRT_SECURE_NO_DEPRECATE
#include <cpprest/http_listener.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <thread>
#include <chrono>
#include <ctime>
// Minimal HTTP server in 0MQ
#include "czmq.h"
int main (void)
{
zctx_t *ctx = zctx_new ();
void *router = zsocket_new (ctx, ZMQ_ROUTER);
zsocket_set_router_raw (router, 1);
int rc = zsocket_bind (router, "tcp://*:8080");
assert (rc != -1);
# Outputs the reading time
# Read this in “about 4 minutes”
# Put into your _plugins dir in your Jekyll site
# Usage: Read this in about {{ page.content | reading_time }}
module ReadingTimeFilter
def reading_time( input )
words_per_minute = 180
@juev
juev / .vimrc
Created March 17, 2011 17:41
my ~/.vimrc file
" http://vimdoc.sourceforge.net/htmldoc/starting.html#vimrc
set nocompatible " use vim defaults
set scrolloff=3 " keep 3 lines when scrolling
set ai " set auto-indenting on for programming
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
@juev
juev / .Xmodmap
Created March 18, 2011 13:58
~/.Xmodmap for Apple Aluminium Keyboard with Numeric Keypad
remove mod4 = Super_L Super_R
remove control = Control_L Control_R
keycode 37 = Super_L
keycode 105 = Super_R
keycode 133 = Control_L
keycode 134 = Control_R
add Control = Control_L Control_R
add mod4 = Super_L Super_R
@juev
juev / .Xmodmap
Created March 28, 2011 16:51
~/.Xmodmap for Genius keyboard
remove mod4 = Super_L Super_R
remove control = Control_L Control_R
remove mod1 = Alt_L Alt_R
keycode 37 = Super_L
keycode 105 = Super_R
keycode 64 = Control_L
keycode 108 = Control_R
keycode 133 = Alt_L
keycode 134 = Alt_R
add Control = Control_L Control_R
// Mixins ---------------------------------------------------------------
=placeholder
&::-webkit-input-placeholder
@children
&:-moz-placeholder
@children
&.placeholder
@children
@juev
juev / markdown
Created April 24, 2011 17:13
Site article about markdown
---
layout: post
title: Markdown
description: Использование markdown для создания web-страниц. Особенности различных движков.
keywords: markdown,rdicount,kramdown,maruku
---
**[Markdown][1]{: rel="nofollow"}** — это облегченный язык разметки, призванный облегчить подготовку текстов для публикации в Интернете.
Собственно, Markdown — это простой текст.
@juev
juev / xmonad.hs
Created May 30, 2011 16:39
Config xmonad by Omever
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, TypeSynonymInstances, FlexibleContexts, NoMonomorphismRestriction #-}
--
-- xmonad example config file.
--
-- A template showing all available configuration hooks,
-- and how to override the defaults in your own xmonad.hs conf file.
--
-- Normally, you'd only override those defaults you care about.
--