Skip to content

Instantly share code, notes, and snippets.

@caiorss
caiorss / ps.el
Created February 28, 2017 00:00 — forked from kurohuku/ps.el
(defun postscript-process ()
(get-buffer-process (get-buffer "*postscript*")))
(defun run-postscript ()
(interactive)
(require 'comint)
(switch-to-buffer (make-comint "postscript" "gs")))
(push '("postscript" . utf-8) process-coding-system-alist)
@caiorss
caiorss / bulletins_anonym_1.ps
Created February 27, 2017 23:47 — forked from fabienhinault/bulletins_anonym_1.ps
postscript file for vote bulletins
%!PS
%%DocumentMedia: a4 595 842 80 () ()
/pageHeight 842 def
/pageWidth 595 def
<< /PageSize [pageWidth pageHeight] >> setpagedevice
/mm { 2.834645669 mul } def
@caiorss
caiorss / logo.ps
Created February 27, 2017 23:47 — forked from larryv/logo.ps
MIT logo in PostScript
newpath
300.0 400.0 moveto
gsave
currentpoint translate
-241.66666666666669 0.0 rmoveto
108.33333333333334 0.0 rmoveto
gsave
currentpoint translate
-108.33333333333334 0.0 rmoveto
25.0 0.0 rmoveto
@caiorss
caiorss / .emacs
Created February 20, 2017 15:24 — forked from snoyberg/.emacs
Michael Snoyman's .emacs file: Stack, haskell-mode, evil-mode
;; Get package installation ready
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
;; Bootstrap `use-package'
(unless (package-installed-p 'use-package)
(package-refresh-contents)
@caiorss
caiorss / packages.el
Created February 20, 2017 15:23 — forked from dysinger/packages.el
Private spacemacs layer to try out Chris Done's Intero mode for haskell
;; 1. place this in ~/.emacs.d/private/intero/packages.el
;; 2. add intero, syntax-checking and auto-completion to your
;; ~/.spacemacs layer configuration & remove the haskell layer
;; if you were using that before
;; 3. make sure you have stack installed http://haskellstack.org
;; 4. fire up emacs & open up a stack project's source files
@caiorss
caiorss / .spacemacs
Created February 18, 2017 22:01 — forked from ulyssesdotcodes/.spacemacs
My spacemacs
dotspacemacs-default-font '("Source Code Pro"
:size 18
:weight normal
:width normal
:powerline-scale 1.1)
(server-start)
(setq haskell-default-program "stack ghci")
#!/usr/bin/env zsh
# ----------------------------------------------------------------------
# Send the standard input into a running emacs server, either on the
# kill ring, in a specified register, or in a new buffer. Examples:
# echo -n some text into the kill ring | into-emacs
# echo -n other text into register 1 | into-emacs -r 1
# long_command | into-emacs -b "long command output"
@caiorss
caiorss / magit-profiles.el
Last active February 18, 2017 02:05
Magit with multiple profiles
;;;; ================= Way 1 =================
;; Before commit with work profile use M-x magit-status-work
;;
(defun magit-status-work ()
(interactive)
(setenv "GIT_AUTHOR_NAME" "work user")
(setenv "GIT_AUTHOR_EMAIL" "[email protected]")
(magit-status default-directory))
@caiorss
caiorss / swithc-buffer-major-mode-types.el
Created February 17, 2017 19:59
Emacs/ Elisp - Switch between buffer types. Example switch between only c++ *.cpp (c++-mode), files, c-mode *.c, c-mode *.h and so on.
;; Question: Is there a package/lisp code that lets me cycle through filetype buffers?
;; Reddit tpic: https://www.reddit.com/r/emacs/comments/5tjgsb/is_there_a_packagelisp_code_that_lets_me_cycle/
;;
;;
(require 'helm) ;;
(require 'cl) ;;
(defun switch-buffer-type (buffer-major-mode file-extension)
(let ((items (mapcar
(lambda (buf) (cons (buffer-name buf) buf))
@caiorss
caiorss / haddock-escape.el
Created February 15, 2017 00:14 — forked from 23Skidoo/haddock-escape.el
An Elisp function for escaping special characters in Haddock's @ code blocks
; See http://www.haskell.org/haddock/doc/html/ch03s08.html#idp1371070500
; and http://www.haskell.org/haddock/doc/html/ch03s08.html#idp1371060908
;
; Examples:
; \, /, ', `, ", @, < ===> \\, \/, \', \`, \", \@, \<
; foo `fmap` bar "/a/b" ===> foo \`fmap\` bar \"\/a\/b\"
(defun haddock-escape (start end)
"Escape symbols that have special meaning in Haddock comments."
(interactive "r")
(replace-regexp "\\([^\\\\]?\\)\\(`\\|'\\|\\\"\\|@\\|<\\|/\\|\\\\\\)" "\\1\\\\\\2" nil start end))