Skip to content

Instantly share code, notes, and snippets.

#lang racket
(require racket/system
racket/async-channel)
(provide watch-repo
make-store)
(define git-command (make-parameter #f))
(define commit-delay (make-parameter #f))
#lang typed/racket
(define elem : (Option (Channelof String)) #f)
;; comment this form to make the problem disapear
(define (problematic-form)
(set! elem (ann (make-channel) (Channelof String))))
(define (test) : Void
(when elem
#lang typed/racket
(define-type Elem (U 'a 'b 'c))
(define (lst-ok [types : (Listof (U Elem (Listof Elem)))]) : (Listof Elem)
(let loop ([types types]
[result : (Listof Elem) (list)])
(if (empty? types)
result
#lang racket
(require (for-syntax syntax/parse))
;; Pour faire un break point mettre faire une function breakpoint
(define current-running (make-parameter #t))
(define debug-tag (make-continuation-prompt-tag 'debug))
@antoineB
antoineB / php extra
Created September 23, 2014 11:48
Extra stuff for my php work
;;; php-extra.el --- My extra stuff for php files -*- lexical-binding: t; -*-
;; Copyright (C) 2014
;; Author: <antoineB>
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
@antoineB
antoineB / quick search
Created September 19, 2014 21:15
extract all symbols and uniquify from buffer/region
(require 'org)
(require 'org-element)
(defun org-lt--extract-text ()
(org-element-map
(org-element-parse-buffer)
'(paragraph headline)
(lambda (element)
(if (equalp 'headline (org-element-type element))
(org-lt--extract-headline element)
#lang racket
(define (module->syntax file)
(define in (open-input-file file))
(port-count-lines! in)
(read-accept-reader #t)
(begin0
(read-syntax (string->path file) in)
(close-input-port in)))
(defn- valid-argument? [data]
(or (symbol? data)
(vector? data)
(map? data)))
(defn- insert-in-list-second-position [the-list argument]
(let [r (rest list)]
(concat (list (first list) argument) r)))
(ns schema.core
(:require [goog.graphics :as graphics]
[goog.dom :as dom]
[goog.events :as events]))
(def canvas (graphics/createGraphics 200 150))
(.render canvas (dom/getElement "trash"))
(def circle (.drawCircle canvas 20 20 25 nil (graphics/SolidFill. "red")))