Skip to content

Instantly share code, notes, and snippets.

View saevarb's full-sized avatar

Sævar Berg saevarb

  • NTT Data BS Nordics
  • Odense, Denmark
View GitHub Profile
Alright, so let's say you want to 'bucket fill' at some coordinate (x,y)
Let's pretend that the pixels at the coordinate look like this
123
456
789
That is, you have (x, y) pointing to the pixel '5' in this case.
{-# LANGUAGE RecordWildCards #-}
import Control.Applicative ((<$>))
import Text.Parsec hiding (label)
import Text.Parsec.String
import Data.Either
data SemanticVersion
= SemanticVersion
{ major :: Int
, minor :: Int
import os
l = []
# Hvis du gør noget i denne retning
for i in range(10):
print(i)
foo = os.popen("trackmania command etc")
l.append((i, foo))
for (i, p) in l:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[]) {
long n = 0;
if(argc < 2) {
printf("gief args bro\n");
return 1;
}
remdups :: Eq a => [a] -> [a]
remdups =
foldr rm []
where
rm a [] = [a]
rm a (x:l) =
if a == x
then x:l
else a:x:l
;; "after" macro definition
; (if (fboundp 'with-eval-after-load)
; (defmacro after (feature &rest; body)
; "After FEATURE is loaded, evaluate BODY."
; (declare (indent defun))
; `(with-eval-after-load ,feature ,@body))
; (defmacro after (feature &rest; body)
; "After FEATURE is loaded, evaluate BODY."
; (declare (indent defun))
; `(eval-after-load ,feature
(if (fboundp 'with-eval-after-load)
(defmacro after (feature &rest; body)
"After FEATURE is loaded, evaluate BODY."
(declare (indent defun))
`(with-eval-after-load ,feature ,@body))
(defmacro after (feature &rest; body)
"After FEATURE is loaded, evaluate BODY."
(declare (indent defun))
`(eval-after-load ,feature
'(progn ,@body))))))
;; Given that I have a list of my packages as follows:
;; '((package package-require) (package))
;; Where each element in the list is a list containing
;; either 1 element e, which means I just need to do
;; (package-install e) and (require e)
;; or two elements, e and r, which means I need to do
;; (package-install e) but (require r)
;; Much like I want to (package-install helm) but
;; (require helm-config)
;; Is there something that does something similar to this already, or
(use-package tex
:ensure auctex
:config
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq TeX-command-default "LatexMk")
(setq-default TeX-master nil)
(add-hook 'LaTeX-mode-hook 'visual-line-mode)
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(TeX-view-program-list
(quote
(("zathura"
((output-pdf "zathura --fork"))
"zathura"))))