Skip to content

Instantly share code, notes, and snippets.

@avli
avli / gitignore_global
Created July 3, 2014 05:13
My gitignore_global
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@avli
avli / yay.cxx
Created July 3, 2014 07:45
test of boost::python vector to python lits conversion
#include <boost/python.hpp>
#include <vector>
#include <string>
char const* yay()
{
return "Yay!";
}
@avli
avli / init.el
Last active August 29, 2015 14:07
(setq inhibit-splash-screen t)
(setq default-directory "~")
;; I use cedet development branch, which install in
;; ~/.emacs.d/cedet. To install development branch do
;; (cd ~/.emacs.d && bzr checkout bzr://cedet.bzr.sourceforge.net/bzrroot/cedet/code/trunk cedet)
(let ((cedet-dir "~/.emacs.d/cedet"))
(if (file-directory-p cedet-dir)
(load-file "~/.emacs.d/cedet/cedet-devel-load.el")))
@avli
avli / .vimrc
Last active August 16, 2017 08:53
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
" To install Vundle run
" git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
call vundle#begin()
@avli
avli / init.el
Last active August 29, 2015 14:07
(setq inhibit-splash-screen t)
(setq default-directory "~")
(setq default-input-method 'russian-computer)
(setenv "PATH"
(concat (getenv "PATH")
":/usr/local/bin:/usr/texbin"))
(setq exec-path (setq exec-path
@avli
avli / calc.py
Created October 26, 2014 07:46
RPN calculator in Python
# -*- coding: utf-8 -*-
"""
RPN calculator implementation.
"""
import math
import sys
def rpn(expr):
@avli
avli / gnus.el
Last active January 26, 2020 03:29
Simple Gnus configuration for reading Gmane
(setq gnus-select-method '(nntp "news.gmane.org"))
(setq gnus-thread-sort-functions
'(gnus-thread-sort-by-most-recent-number
gnus-thread-sort-by-subject
(not gnus-thread-sort-by-total-score)
gnus-thread-sort-by-most-recent-date))
(setq-default
gnus-summary-line-format "%U%R%d %-5,5L %-20,20n %B%-80,80S\n"
set nu
set tabstop=8
set expandtab
set shiftwidth=4
set softtabstop=4
set autoindent
set backspace=2
" disable all colors
(defun natural-random (limit)
(1+ (random limit)))
(defun select-track ()
(interactive)
(let ((cup-number (natural-random 10))
(track-number (natural-random 4)))
(message (format "Cup #%i, track #%i" cup-number track-number))))
(select-track)
@avli
avli / GSA.R
Last active August 29, 2015 14:25
initialization <- function(dims, N, low, up) {
data <- runif(N * dims, low, up)
matrix(data, nrow=N)
}
zeros <- function(N, dims) {
matrix(rep(0, dims * N), nrow=N)
}