This file contains hidden or 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
DST=emmet-mode.el | |
all: emmet-mode.el | |
emmet-mode.el: src/snippets.el src/preferences.el src/* | |
cat /dev/null > $(DST) | |
cat src/comments.el >> $(DST) | |
cat src/init.el >> $(DST) | |
cat src/snippets.el >> $(DST) | |
cat src/preferences.el >> $(DST) |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import re | |
class MultipleDimensionsTable(object): | |
def __init__(self): | |
self.src = [] | |
def _convert(self, i, j, vs): | |
v = vs[i][j] |
This file contains hidden or 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
(def filter (f lis) (mappend [if (f _) (list _)] lis)) | |
(def cardify (str) (map string (pair (coerce str 'cons)))) | |
(def level (c) (pos (c 1) "3456789TJQKA2")) | |
(def levcomp (f a b) | |
(and (no (is a "Jo")) (or (is b "Jo") (f (level a) (level b))))) | |
(def find-same-levels (lev-cord mine n) | |
(let result '() | |
((afn (lev-cord mine n acc) | |
(if (is n 0) |
This file contains hidden or 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
(= opposite '(2 3 0 1)) | |
(= pattern '((2 3 0 1) (1 0 3 2) (3 2 1 0))) | |
(= adjacent (list [if (< -1 (- _ 3)) (- _ 3)] ; up | |
[if (< (mod _ 3) 2) (++ _)] ; right | |
[if (< (+ _ 3) 9) (+ _ 3)] ; down | |
[if (< 0 (mod _ 3)) (-- _)])) ; left | |
(def run (lis idx side) | |
(let next ((pattern (lis idx)) side) | |
(cons idx |
This file contains hidden or 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
(= x 5 n (- (* x x) 1)) | |
(def get-tbl bans | |
(let o (map [rem nil `(,(if (< (mod _ x) (- x 1)) (+ _ 1)) ;right | |
,(if (< (/ _ x) (- x 1)) (+ _ x)) ; bottom | |
,(if (> (mod _ x) 0) (- _ 1)) ;left | |
,(if (>= (/ _ x) 1) (- _ x)))] ; about | |
(range 0 n)) | |
(aif (car bans) | |
(each x it (= (o (x 0)) (rem (x 1) (o (x 0))) |
This file contains hidden or 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
(= poss (map (fn (x) (map (fn (y) (cons x y)) (range 0 7))) (range 0 7))) | |
(def setxy ((x . y) b c) | |
(if (and (<= 0 x) (< x 8) (<= 0 y) (< y 8)) | |
(+ (firstn y b) | |
(let cd (nthcdr y b) | |
(+ (let l (copy (car cd)) (= (l x) c) (list l)) (cdr cd)))) | |
b)) | |
(def getxy ((x . y) b) (if (and (<= 0 x) (< x 8) (<= 0 y) (< y 8)) ((b y) x))) |
This file contains hidden or 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
(def get-pos ((y . x)) (and (<= 0 y) (< y h) (<= 0 x) (< x w) ((maze y) x))) | |
(def dig-pos ((y . x)) (sref (maze y) nil x) (cons y x)) | |
(def get-dir-pos ((y . x) d n) | |
(case d | |
a (cons (- y n) x) b (cons (+ y n) x) | |
l (cons y (- x n)) r (cons y (+ x n)))) | |
(def can-dig? (pos d) (get-pos (get-dir-pos pos d 2))) | |
(def dig (pos d) (dig-pos (get-dir-pos pos d 1)) (dig-pos (get-dir-pos pos d 2))) |
This file contains hidden or 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
#!/usr/bin/env python -S | |
# -*- coding: utf-8 -*- | |
import sys | |
import re | |
import xml.sax | |
import io # for 2.6 | |
import StringIO # for 3.0 | |
# | |
# ** If your python is 2.x and xml-cording is utf-8 set follows. |
This file contains hidden or 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
;; Working in mzscheme 372 (NOT working in GaucheScheme 0.9.2) | |
;; Refered to 3imp.pdf (http://www.cs.indiana.edu/~dyb/papers/3imp.pdf) Chapter 2 Heap Based Model. | |
;; I added two new assembly-operators 'beg' and 'appen' to support syntaxes 'begin' and 'define'. | |
(require (lib "defmacro.ss")) | |
;; utils | |
(define-macro (record vars val . exps) | |
`(apply (lambda ,vars ,@exps) ,val)) |
This file contains hidden or 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
(function(){ | |
for(var i=1,f=1,b=1,fizz=3,buzz=5;i<101; i++) { | |
var r = ''; var fp=(f*fizz==i); var bp=(b*buzz==i); | |
if(fp||bp) { | |
if (fp) { r+="Fizz"; f++;} | |
if (bp) { r+="Buzz"; b++;} | |
} else r+=i; | |
console.log(r); | |
} | |
})(); |
NewerOlder