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
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. |
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
{-# LANGUAGE RecordWildCards #-} | |
import Control.Applicative ((<$>)) | |
import Text.Parsec hiding (label) | |
import Text.Parsec.String | |
import Data.Either | |
data SemanticVersion | |
= SemanticVersion | |
{ major :: Int | |
, minor :: Int |
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 | |
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: |
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 <stdlib.h> | |
int main(int argc, char* argv[]) { | |
long n = 0; | |
if(argc < 2) { | |
printf("gief args bro\n"); | |
return 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
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 |
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
;; "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 |
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
(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)))))) |
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
;; 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 |
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
(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) |
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
(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")))) |