This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Map Meta-m in bash to a function displaying man for the command you are entering | |
# Useful for looking up arguments | |
function split-command { man ${READLINE_LINE%% *}; } | |
bind -x '"\em":"split-command"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Map.hpp" | |
#include <iostream> | |
template <class Key, class T, class Compare> | |
Map<Key, T, Compare>::Node::Node(const value_type& _data) : data(_data) { | |
left = right = NULL; | |
height = 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CFLAGS = -m32 | |
text: main.o text.o | |
gcc $(CFLAGS) main.o text.o -o text | |
main.o: text.c | |
gcc $(CFLAGS) -c text.c -o main.o | |
text.o: text.s | |
nasm -f elf text.s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VTKFile type="UnstructuredGrid"> | |
<UnstructuredGrid> | |
<!-- kawal danych --> | |
<Piece NumberOfPoints="3" NumberOfCells="1"> | |
<!-- wartosci w punktach --> | |
<PointData Scalars="Coolness"> | |
<DataArray Name="Coolness" type="Float32"> | |
1.0 | |
1.0 | |
1.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <unistd.h> | |
char* logo = | |
" ____ ____ ____ ____\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set shell=/bin/sh | |
" vundle | |
filetype off | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
Bundle 'gmarik/vundle' | |
" paczki | |
Bundle 'tpope/vim-fugitive' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat ~/.tmux.conf | |
set-option -g prefix C-a | |
bind-key C-a last-window | |
bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'" | |
set -g mode-mouse on | |
set -g mouse-resize-pane on | |
set -g mouse-select-pane on | |
set -g mouse-select-window on | |
set -g base-index 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% funkcja pierwotna | |
f = @(x1,x2) 10*(2*x2.^2-x1).^2+(x2-2).^2; | |
% gradient | |
df = @(x) [ | |
20*x(1) - 40*x(2)^2; | |
2*x(2) - 80*x(2)*(x(1) - 2*x(2)^2) - 4 | |
] | |
% macierz drugich pochodnych |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import inspect | |
def record_point(name=''): | |
pid = os.getpid() | |
f = inspect.currentframe() | |
# redis.set ... | |
print('{} = {}:{}:{}'.format( | |
pid, | |
f.f_back.f_code.co_filename, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import connection, models | |
class PrefetchIDMixin(object): | |
def prefetch_id(self): | |
# <https://djangosnippets.org/snippets/2731/> | |
cursor = connection.cursor() | |
cursor.execute( | |
"SELECT nextval('{0}_{1}_{2}_seq'::regclass)".format( | |
self._meta.app_label.lower(), |
OlderNewer