Skip to content

Instantly share code, notes, and snippets.

Avatar

Роман Захаров zahardzhan

View GitHub Profile
@zahardzhan
zahardzhan / stumpwm.rc.lisp
Created Sep 17, 2015
My StumpWM Setup (2010)
View stumpwm.rc.lisp
;; -*-lisp-*-
(in-package :stumpwm)
(defun cat (&rest strings)
(apply 'concatenate 'string strings))
(defparameter foreground-color* "white")
(defparameter background-color* "black")
(defparameter border-color* "black")
View geolinks.snowflake.clj
@zahardzhan
zahardzhan / autoexec.cfg
Created Aug 1, 2015
Easy sound modes switch & tactical mode.
View autoexec.cfg
con_enable 1
con_filter_enable 1
con_filter_text [
con_notifytime 1.7
developer 1
alias +smpm+vr "+sixense_map_ping_mode; +voicerecord"
alias +smpm-vr "+sixense_map_ping_mode; -voicerecord"
alias -smpm-vr "-sixense_map_ping_mode; -voicerecord"
alias +tacticalmode +smpm+vr
alias -tacticalmode -smpm-vr
@zahardzhan
zahardzhan / Send More Money.md
Last active Aug 29, 2015
Занятная задачка с хабра иллюстрирующая монады списка.
View Send More Money.md

Паззл Send More Money

Занятная задачка с хабра иллюстрирующая монады списка.

Оригинал http://habrahabr.ru/company/infopulse/blog/260809

Ну и вот вам задачка, которая может попасться на собеседовании. Она не совсем тривиальна, возможно несколько подходов к решению и лучший из них не сразу очевиден — как-раз то, над чем стоит подумать. Вам предлагается следующий пазл:

@zahardzhan
zahardzhan / gist:a68ce2d139f9f95b0456
Created Jan 24, 2015
Dota 2 Voice & Open Micro Toggle
View gist:a68ce2d139f9f95b0456
// Put in Program Files (x86)/Steam/steamapps/common/dota 2 beta/dota/cfg/autoexec.cfg
alias vo/+ "voice_enable 1; vo/om-~"
alias vo/- "voice_enable 0"
alias vo/om~ "vo/om+~"
alias vo/om+ "voice_vox 1"
alias vo/om- "voice_vox 0"
alias vo/om+~ "vo/om+; alias vo/om~ vo/om-~"
alias vo/om-~ "vo/om-; alias vo/om~ vo/om+~"
bind kp_multiply vo/om~
bind kp_minus vo/-
@zahardzhan
zahardzhan / Common Words.md
Last active Jul 31, 2016
Program Pearls, Continued: Common Words, Clojure
View Common Words.md

Program Pearls, Continued: Common Words (1986)

from Literate Programming, D. Knuth, 1992, Chapter 6.

The purpose of this program is to solve the following problem posed by Jon Bentley:

Given a text file and an integer k, print the k most common words in the file (and the number of their occurrences) in decreasing frequency.

Solution

View network.cs
using System;
using System.Linq;
using System.Net.Sockets;
namespace T
{
///<summary>
/// Сетевой актор подключается к серверу и пересылает сообщения. При обрыве связи самостоятельно
/// её восстанавливает.
/// </summary>
@zahardzhan
zahardzhan / myactors.cs
Created Oct 6, 2011
F# vs Zahardzhan's C# actors
View myactors.cs
// type Message = Finished | Msg of int * Message MailboxProcessor
// let (<--) (m:MailboxProcessor<_>) x = m.Post(x)
// let ping iters (outbox : Message MailboxProcessor) =
// MailboxProcessor.Start(fun inbox ->
// let rec loop n = async {
// match n with
// | 0 -> outbox.Post Finished
// printfn "ping finished"
View downloadsomemusic.py
#!/usr/bin/python
# Script for downloading music from sites:
# www.mnogomp3.net
# www.tenshi.spb.ru
import getopt
import sys
import os
import re
View loops.clj
;;; -*- mode: clojure; coding: utf-8 -*-
;;;
;;; Loops — Common Lisp Iterate macro for Clojure
;;;
;;; Copyright 1989 by Jonathan Amsterdam
;;; Adapted to ANSI Common Lisp in 2003 by Andreas Fuchs
;;; Adapted to Clojure in 2010 by Roman Zaharov @zahardzhan <zahardzhan@gmail.com>
;;;
;;; Permission to use, copy, modify, and distribute this software and its
;;; documentation for any purpose and without fee is hereby granted,