Skip to content

Instantly share code, notes, and snippets.

@Idorobots
Idorobots / gist:3955696
Created October 25, 2012 21:57
The parallel HerpDerp VM.
uint[] code = [0,
DERP,
RECEIVE,
CMP, 1,
JUMPL, 1,
MOVEA, 1,
ADDMEM, 0,
CMP, 1,
MOVEAD,
MOVEA, 0,
@Idorobots
Idorobots / gist:3894107
Created October 15, 2012 18:15
ASM DFD generator
(DFD (Database "Dane_Klientów")
(I/O "Klient")
(Process "Weryfikacja_Zamówienia")
(Flow "Zamówienie" "Klient" "Weryfikacja_Zamówienia")
(Flow "Odmowa" "Weryfikacja_Zamówienia" "Klient")
(Process "Weryfikacja_Danych_Kredytowych")
(Flow "Zweryfikowane_zamówienie" "Weryfikacja_Zamówienia" "Weryfikacja_Danych_Kredytowych")
(Flow "Informacja_o_błędnych_danych" "Weryfikacja_Danych_Kredytowych" "Klient")
(Flow "Gotowe_zamówienie" "Weryfikacja_Danych_Kredytowych" "Wykonanie_Zamówienia")
(Process "Wykonanie_Zamówienia")
@Idorobots
Idorobots / gist:3889721
Created October 14, 2012 20:27
sample makefile
RM = rm
CC = gcc
CFLAGS = -Wall -pedantic -O4 -ffast-math
LDLIBS = -lm
TARGET = foo
OBJS = foo.o main.o
all: $(TARGET)
@Idorobots
Idorobots / gist:3867095
Created October 10, 2012 17:30
Mode-line images
(defvar some-image (create-image "foo.xpm" 'xpm nil
:ascent 'center))
(setq mode-line-format
(list ;; ...
'(:eval (propertize "unimportant" 'display some-image))
;; ...
))
@Idorobots
Idorobots / gist:3867068
Created October 10, 2012 17:24
Tool tips
(setq mode-line-format
(list ;; ...
'(:propertize "%@" help-echo (concat "Default directory is: "
default-directory)
mouse-face mode-line-highlight)
;; ...
))
@Idorobots
Idorobots / gist:3867028
Created October 10, 2012 17:17
VC colors
(defvar my-vc-alist '(;; Everything is ok:
(up-to-date some-green-face)
;; Kinda important:
(edited some-yellow-face)
(added some-yellow-face)
;; Most important:
;; ...
))
(setq mode-line-format
@Idorobots
Idorobots / gist:3866974
Created October 10, 2012 17:09
Mode-line format
(setq mode-line-format
(list '(:eval (message "Using `message' here is a bad idea..."))
'(:propertize " No really. Stop it!"
face font-lock-warning-face)
))
@Idorobots
Idorobots / gist:3866870
Created October 10, 2012 16:53
Mode-line code
;; MODES
(require 'battery)
(setq battery-mode-line-format "#%b %p %t")
(setq battery-load-critical 7)
(setq battery-load-low 25)
(display-battery-mode t)
(require 'network-speed)
(setq network-speed-update-interval 5)
@Idorobots
Idorobots / gist:3865039
Created October 10, 2012 11:41
Misc Stats example
(require 'misc-stats)
(setq misc-stats-update-interval 10)
(setq misc-stats-format "Emacs uptime: %E Load average: %L1")
(misc-stats-start)
@Idorobots
Idorobots / gist:3865021
Created October 10, 2012 11:39
Network Stats example
(require 'network-speed)
(setq network-speed-update-interval 5)
(setq network-speed-precision 1)
(setq network-speed-interface-list '("wlan0" "eth0"))
(setq network-speed-format-string "Down: %RB Up: %TB")
(network-speed-start)