Archive for the ‘ Programming ’ Category
Below are functions that can be used to switch to next or previus buffer in the same major mode (defun buffer-same-mode (change-buffer-fun) (let ((current-mode major-mode) (next-mode nil)) (while (not (eq next-mode current-mode)) (funcall change-buffer-fun) (setq next-mode major-mode)))) (defun previous-buffer-same-mode () (interactive) (buffer-same-mode #'previous-buffer)) (defun next-buffer-same-mode () (interactive) (buffer-same-mode #'next-buffer)) In my init file I have [ READ MORE ]
I wanted to speed up jumping in the same buffer so I have written this bookmarking utility (Similar to built-in registers) and put it in my .emacs file. (defvar bookmark-markers '()) (defun bookmark (bookmark) "Store current position for this buffer in bookmar-markers a-list" (interactive "nBookmark: ") (let* ((buffer (current-buffer)) (bookmarks (let ((pair (assoc buffer bookmark-markers))) [ READ MORE ]
Here’s the code I wrote for matrix manipulation in scheme. It use lists. Procedure that creates new square identity matrix: (define (make-matrix n) (let outter ((i n) (result '())) (if (= i 0) result (outter (- i 1) (cons (let inner ((j n) (row '())) (if (= j 0) row (inner (- j 1) (cons [ READ MORE ]
I saw this video on YouTube from DefCon Conference. I go to samy website, and it’s web application which look like Microsoft Windows. So first think I do to see how it is build. I look at source code and it’s look like there is no code at all, but in the middle (line 281) [ READ MORE ]
This is my latest jquery plugin — “splitter” which splits content vertically or horizontally with movable element between them, that allow to change the proportion of two element. You can get it from github[ READ MORE ]
When I download files form rapidshare or other file hosting sites I occasionally download movies that are splited into parts, and to watch the movie they need to be concatenated. I came up with this bash function which I put in my .bashrc file: function concat() { files=${@:1:$(($#-1))} cat $files | pv -s $(du -cb [ READ MORE ]
To convert pdf to jpg on windows you can use existing open source tools ImageMagic and GhostScript. Get and Install latest ImageMagic from: http://www.imagemagick.org/script/binary-releases.php#windows Ensure that you install with OLE support (for scripting with VBScript) Get and install latest GPL version of Ghostcript from sourceforge http://sourceforge.net/projects/ghostscript/files/GPL%20Ghostscript/ Unfortunately there is no GUI for ImageMagic but you [ READ MORE ]
To jest kod skryptu w Ruby do wyświetlania definicji ze “Słownika Wyrazów Obcych Kopalińskiego”. Pobierz plik kopalinski.rb. Żeby użyć tego skryptu musisz mieć zainstalowanego Ruby-ego. W terminalu wpisz: kopalinski.rb Słownik Skrypt wyświetli definicje słowa “Słownik”. Jeśli w słowniku Kopalińskiego nie ma jakiegoś słowa skrypt nie wyświetla nic[ READ MORE ]
My new project JQuery Terminal Emulator. It’s a plug-in which can be used to add Command Line interface to your application. You can use it to easily create server configuration tool or can be help in debugging or testing server side of AJAX applications. You can put lots of options in one place. You can [ READ MORE ]
I need a script to compress css file, and I wrote this python one liner to do this. It removes unnecessary white space and strip comments. python -c 'import re,sys;print re.sub("\s*([{};,:])\s*", "\\1", re.sub("/\*.*?\*/", "", re.sub("\s+", " ", sys.stdin.read())))'[ READ MORE ]
Get every new post delivered to your Inbox.
Join 69 other followers