Command-line
sudo apt-get install ack-grep
sudo dpkg-divert --local --divert /usr/bin/ack --rename --add /usr/bin/ack-grep
.vimrc
nnoremap <leader>a :Ack
" Search for word under cursor
nnoremap A :Ack
(add-to-list 'load-path "~/.emacs.d") | |
;; Increase window size | |
(if (window-system) | |
(set-frame-size (selected-frame) 124 40)) | |
; Add more package sources | |
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/") | |
("org" . "http://orgmode.org/elpa/") | |
("marmalade" . "http://marmalade-repo.org/packages/") |
__author__ = 'mep' | |
import getopt | |
import sys | |
from bitstring import BitArray | |
line_bit_rates = ['614.4', # 0 filling bytes | |
'1228.8', # 1 | |
'invalid', # 2 | |
'2457.6', # 3 |
-- A variation of the LOVE calculator. | |
-- There are three versions of the actual calculator, they were provided as | |
-- answers to my question at Quora: | |
-- http://www.quora.com/How-do-I-sum-numbers-in-lists-by-pairs-until-just-one-pair-is-left | |
-- To try them out, replace the function call on line 66. | |
import Data.Char | |
import System.IO | |
import Data.List.Split |
Command-line
sudo apt-get install ack-grep
sudo dpkg-divert --local --divert /usr/bin/ack --rename --add /usr/bin/ack-grep
.vimrc
nnoremap <leader>a :Ack
" Search for word under cursor
nnoremap A :Ack
-module(pairs). | |
-export([main/0]). | |
%%%% | |
%% Counting characters in strings | |
%%%% | |
%% Count number of occurences of C in X. | |
count_char_in_string(C, X) -> length([Ch || Ch <- X, | |
Ch == C]). |
# Requires repo tool from https://code.google.com/p/git-repo/ | |
repo forall -p -c "git log -n 1 --pretty=tformat:'%Cblue%an%Creset|%ar|%s'" | column -t -s '|' |
git log --oneline --shortstat --author=Marko --pretty=tformat:'%Cblue%H%Creset|%ar|%s' | column -t -s '|' |
#include <sysfs/libsysfs.h> | |
#include <stdio.h> | |
/** | |
* @brief Lists all the devices in the given class. | |
* | |
* @param className Name of the class (in /sys/class). | |
*/ | |
void sysFsListDevices(char *className) | |
{ |
#include <stdio.h> | |
#include <math.h> | |
int main() | |
{ | |
int result; | |
double x; | |
int i; | |
for (i=-100;i<101;i++) |