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
@juev
juev / nginx.conf
Created May 30, 2011 17:51
nginx.conf for my sites
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
use epoll;
worker_connections 1024;
multi_accept on;
# загружаем дефолтный профиль оболочки
source /etc/profile
# Настраиваем клавиши
source ~/.zsh_key
source ~/.zsh_aliase
source ~/.zsh_function
# Use hard limits, except for a smaller stack and no core dumps
unlimit
case $TERM in
linux)
bindkey "^[[2~" yank
bindkey "^[[3~" delete-char
bindkey "^[[5~" up-line-or-history
bindkey "^[[6~" down-line-or-history
bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line
bindkey "^[e" expand-cmd-path ## C-e for expanding path of typed command
bindkey "^[[A" up-line-or-search ## up arrow for back-history-search
# цветной grep
alias grep='grep --color=auto'
# более человекочитаемые df и du
alias df='df -h'
alias du='du -h'
# переименование-перемещение c пogтвepжgeнueм без коррекции
alias mv='nocorrect mv -i'
# рекурсивное копирование с подтверждением без коррекции
alias cp='nocorrect cp -iR'
# удаление без подтверждения без коррекции
precmd() {
[[ -t 1 ]] || return
case $TERM in
*xterm*|rxvt|(dt|k|E|a)term*) print -Pn "\e]0;[%~] %m\a"    ;;
screen(-bce|.linux)) print -Pn "\ek[%~]\e\" && print -Pn "\e]0;[%~] %m (screen)\a" ;;  #заголовок для скрина
esac
}
preexec() {
[[ -t 1 ]] || return
-- Standard awesome library
require("awful")
-- Theme handling library
require("beautiful")
-- Notification library
require("naughty")
-- {{{ Variable definitions
-- Themes define colours, icons, and wallpapers
-- The default is a dark theme
@juev
juev / chat.index.html
Created June 26, 2011 10:59 — forked from matthewfl/chat.index.html
A really basic chat server on http://chat.jsapp.us
<html>
<head>
<title>Chat</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script>
$(function () {
function check () {
$("#output").load('/update', function () {
setTimeout(check, 1);
});
@juev
juev / node-and-npm-in-30-seconds.sh
Created June 26, 2011 12:03 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl http://npmjs.org/install.sh | sh
@juev
juev / related_articles_help.rb
Created June 29, 2011 11:33 — forked from owengriffin/related_articles_help.rb
Nanoc helper to list articles related to the current item
module PaginationHelper
# The main pagination method, you should only need to call this
# Returns full HTML markup for pagination links
def pagination(page, pages, uri)
html, ul = [], []
html << pagination_position(page, pages)
if pages > 1
ul << pagination_previous_link(page, uri)
ul << pagination_page_links(page, pages, uri)