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
(require 'sml-mode) | |
(setenv "PATH" (concat "/usr/local/Cellar/smlnj/110.75/libexec/bin:" (getenv "PATH"))) | |
(setq exec-path (cons "/usr/local/Cellar/smlnj/110.75/libexec/bin" exec-path)) | |
;; README | |
;; To load a file and run sml repl -> Press C-c C-v inside a sml file. | |
;; To run the current files tests -> Press C-c C-r inside a sml file. It assumes the tests are inside the same directory. | |
;; For example, If your code file is hw1.sml your test file should be named as hw1tests.sml in the same directory |
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
(defn fancy-mod | |
"Takes the following parameters and | |
returns a function which takes two integer numbers. | |
- operator-fn => Mathematical Operator : + OR * OR / OR - | |
- mod-by => number to mod by, example 2. | |
- output-fn => str or int. | |
Example: | |
((fancy-mod + 2 str) 10 11) |
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
$ brew install nginx-full --with-headers-more-module | |
==> Downloading http://nginx.org/download/nginx-1.6.0.tar.gz | |
Already downloaded: /Library/Caches/Homebrew/nginx-full-1.6.0.tar.gz | |
==> Patching | |
patching file conf/nginx.conf | |
==> ./configure --prefix=/usr/local/Cellar/nginx-full/1.6.0 --with-http_ssl_module --with-pcre --with | |
==> make | |
==> make install | |
Error: Not a directory - (html, /usr/local/var/www) |
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
#lang racket | |
;cons* takes two values and returns a new function | |
;which again takes a function f which is called with the closed over values x y | |
(define (cons* x y) | |
(lambda (f) (f x y))) | |
;car* is a function which takes a function which takes two values | |
;but returns just the first value and ignores the second value | |
;here _ is a way to say that I do take that argument but I dont care about it. |
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
exception NoAnswer; | |
val files : string list = ["Signatures and Hiding Things (7-02).mp4", | |
"A Module Example (11-06).mp4", | |
"Signatures for Our Example (11-03).mp4", | |
"Signature Matching (4-03).mp4", | |
"An Equivalent Structure (6-38).mp4", | |
"Another Equivalent Structure (9-01).mp4", | |
"Different Modules Define Different Types (3-32).mp4", | |
"Equivalent Functions (8-41).mp4", |
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
val Q13_same_con_in_2_datatypes = typecheck_patterns ([("A", "Dt1", IntT), | |
("A", "Dt2", IntT)], | |
[TupleP [ConstructorP ("A", ConstP 20)], | |
TupleP [ConstructorP ("A", ConstP 10)]]); | |
(*val Q13_same_con_in_2_datatypes = SOME (TupleT [Datatype "Dt1"]) : typ option*) |
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
global windowx | |
global mousex | |
tell application "Finder" | |
set boundlist to get bounds of window of desktop | |
end tell | |
set windowx to item 3 of boundlist as string | |
set mousex to do shell script "/Users/firesofmay/mybin/MouseTools -location | head -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
(defn uuid [] (str (java.util.UUID/randomUUID))) |
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
tell application "System Events" | |
keystroke "v" using command down | |
delay 0.1 | |
keystroke "." | |
key code 51 | |
key code 51 | |
key code 36 using control down | |
end tell |
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
from subprocess import Popen, PIPE | |
def run_this_scpt(scpt, args=[]): | |
p = Popen(['osascript', '-'] + args, stdin=PIPE, stdout=PIPE, stderr=PIPE) | |
stdout, stderr = p.communicate(scpt) | |
return stdout | |
#Example of how to run it. | |
run_this_scpt("""tell application "System Events" to keystroke "m" using {command down}""") |