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
;;Haskell setup | |
(defun haskell-custom-setup () | |
(progn | |
(define-key haskell-mode-map (kbd "C-x C-s") 'haskell-mode-save-buffer) | |
(setq haskell-indent-offset 2) | |
(ghc-init) | |
(flymake-mode 1) | |
(defun haskell-mode-stylish-buffer-custom () |
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
{ | |
/* Keybindings for emacs emulation. Compiled by Jacob Rus. | |
* | |
* This is a pretty good set, especially considering that many emacs bindings | |
* such as C-o, C-a, C-e, C-k, C-y, C-v, C-f, C-b, C-p, C-n, C-t, and | |
* perhaps a few more, are already built into the system. | |
* | |
* BEWARE: | |
* This file uses the Option key as a meta key. This has the side-effect | |
* of overriding Mac OS keybindings for the option key, which generally |
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
squareRoot :: Integer -> Integer | |
squareRoot = floor . sqrt . (fromIntegral :: Integer -> Double) | |
isPrime :: Integer -> Bool | |
isPrime 1 = False | |
isPrime x = testDown x (squareRoot x) where | |
testDown a 1 = True | |
testDown a n | |
| a `mod` n == 0 = False | |
| otherwise = testDown a (n-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
import cherrypy | |
import sqlite3 | |
import json | |
def wrap_html(function): | |
def new_function(*args, **kwargs): | |
return """\ | |
<html><body> | |
""" + function(*args, **kwargs) + """ | |
</body></html> |
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
#define DEFAULTTREEHEIGHT 20 | |
#define DEFAULTITERATIONS 1000 | |
#include <sys/time.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <math.h> | |
typedef struct{ | |
void* right; |
NewerOlder