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
git config --global alias.lg "log --color --graph --pretty=format:'%C(auto)%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
http://fredkschott.com/post/2014/02/git-log-is-so-2005/ |
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
wget -q http://londo.ganneff.de/apt.key -O- | apt-key add - | |
echo "deb http://londo.ganneff.de wheezy main" > /etc/apt/sources.list.d/emacs.list | |
aptitude update | |
aptitude install emacs-snapshot |
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
// main thread | |
m_KillThreadEvent.SetEvent(); | |
while (TRUE) { | |
DWORD result; | |
MSG msg; | |
result = ::MsgWaitForMultipleObjects(1, &m_hPositioning, FALSE, INFINITE, QS_ALLINPUT); | |
if (result == (WAIT_OBJECT_0)) { | |
break; | |
} else if (result == ((DWORD)0xFFFFFFFF)) { | |
DWORD e = GetLastError(); |
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
LARGE_INTEGER BeginTime ; | |
LARGE_INTEGER EndTime ; | |
LARGE_INTEGER Frequency ; | |
QueryPerformanceFrequency(&Frequency); | |
QueryPerformanceCounter(&BeginTime) ; | |
//fragment to test | |
QueryPerformanceCounter(&EndTime) ; | |
cout.precision(10); |
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 genromfs.c */ | |
#define ALIGNUP16(x) (((x)+15)&~15) | |
/* from zfs */ | |
#define P2ALIGN(x, align) ((x) & -(align)) | |
#define P2CROSS(x, y, align) (((x) ^ (y)) > (align) - 1) | |
#define P2ROUNDUP(x, align) (-(-(x) & -(align))) | |
#define P2PHASE(x, align) ((x) & ((align) - 1)) | |
#define P2NPHASE(x, align) (-(x) & ((align) - 1)) | |
#define ISP2(x) (((x) & ((x) - 1)) == 0) |
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
CC=gcc | |
CFLAGS=-O3 -funroll-loops -c | |
LDFLAGS=-O2 | |
LDLIBS=-lm | |
SOURCES=MyBot.c YourCode.c ants.c | |
HEADERS=ants.h | |
OBJECTS=$(addsuffix .o, $(basename ${SOURCES})) | |
EXECUTABLE=MyBot | |
all: $(EXECUTABLE) |
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
(defun copy-current-line-position-to-clipboard () | |
"Copy current line in file to clipboard as '</path/to/file>:<line-number>'" | |
(interactive) | |
(let ((path-with-line-number | |
(concat (buffer-file-name) ":" (number-to-string (line-number-at-pos))))) | |
(x-select-text path-with-line-number) | |
(message (concat path-with-line-number " copied to clipboard")))) | |
(define-key global-map (kbd "M-l") 'copy-current-line-position-to-clipboard) |
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
# -*- coding: utf-8- -*- | |
# from: http://piao-tech.blogspot.no/2010/03/get-offlineimap-working-with-non-ascii.html#resources | |
import binascii | |
import codecs | |
# encoding | |
def modified_base64 (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
xprop _NET_WM_PID | cut -d' ' -f3 | |
{click on window} | |
Source: http://unix.stackexchange.com/questions/19161/getting-a-windows-pid-by-clicking-on-it |
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
# https://danielkaes.wordpress.com/2009/03/14/compiling-latex-documents-using-makefiles/ | |
PROJECT= # tex file name here without extension | |
TEX=pdflatex | |
BIBTEX=bibtex | |
BUILDTEX=$(TEX) $(PROJECT).tex | |
all: | |
$(BUILDTEX) | |
$(BIBTEX) $(PROJECT) | |
$(BUILDTEX) |
OlderNewer