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
(defun extract-regex (regexp) | |
"Extracts all occurrences of regexp from the current buffer." | |
(interactive "sRegexp for extraction: ") | |
(setq result '()) | |
(save-excursion | |
(beginning-of-buffer) | |
(while (re-search-forward regexp nil t) | |
(when (match-string 0) ; Got a match | |
(setq result (cons (match-string 0) result))))) | |
(let ((result-string (mapconcat 'identity result "\n"))) |
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
;; This will work as expected: | |
(defmacro create-task-with-out [& body] | |
(let [[code meta] (get-code-and-meta body)] | |
`(let [temp-file-out# (get meta :out-file-obj (create-temp-file))] | |
(Task. (future (wrap-with-out temp-file-out# ~@code)) | |
(assoc ~meta :out-file (.getAbsolutePath temp-file-out#)))))) | |
;; Whereas the following snippet won't work: | |
(defmacro create-task-with-out [& body] | |
(let [[code meta] (get-code-and-meta 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
(ns zeitkonto) | |
(import '(System.Reflection Assembly)) | |
(Assembly/LoadFrom "d:\\WatiN-2.1.0.1196\\bin\\net40\\WatiN.Core.dll") | |
(import '(System DateTime)) | |
(import '(System.Threading ApartmentState Thread ThreadStart)) | |
(import '(WatiN.Core IE Settings)) |
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
// list of exceptions that will be disabled in the script. | |
// if an exception is not yet known to Visual Studio the exception will be added to VS's list of exceptions automatically. | |
let exceptionsToDisable = [|"Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException" | |
"System.Data.SqlClient.SqlException" | |
"System.IO.FileNotFoundException" | |
"System.IO.IOException" | |
"System.IO.PipeException" | |
"System.Net.WebException" | |
"System.NullReferenceException" | |
"System.Reflection.TargetInvocationException" |
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
#r "ReachFramework.dll" | |
#r "WindowsBase.dll" | |
#r "PresentationFramework.dll" | |
#r "PresentationCore.dll" | |
#r "System.Xaml.dll" | |
#r "System.Printing.dll" | |
open System.Windows.Xps.Packaging | |
open System.Windows.Documents |
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
(configure-for-ns gf.job.project.datenbank.simple-patch-db | |
(extends [config.db-server | |
gf.job.datenbank.db-patch] | |
(let [ | |
;; in dieses Verzeichnis werden die Trafo-Skripte generiert und von hier werden sie in das Project-Entwicklungsverzeichnis kopiert | |
trafo-gen-dir "c:\\Users\\me\\Documents\\Scratch\\Database\\Trafos\\1.0A_patches\\" | |
;; Hier landen die EXE-Patches. | |
patches-dst-dir "q:\\Current\\Job.Project\\Current\\Datenbank\\Dev-Patches\\" | |
db-patches-raw (:db-patches (from-ns-config 'gf.job.project.datenbank.db-patches)) |
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
(configure-for-ns 'gf.job.project.datenbank.simple-patch-db | |
(extends ['config.db-server | |
'gf.job.datenbank.db-patch] | |
(let [ | |
;; in dieses Verzeichnis werden die Trafo-Skripte generiert und von hier werden sie in das Project-Entwicklungsverzeichnis kopiert | |
trafo-gen-dir "c:\\Users\\me\\Documents\\Scratch\\Database\\Trafos\\1.0A_patches\\" | |
;; Hier landen die EXE-Patches. | |
patches-dst-dir "q:\\Current\\Job.Project\\Current\\Datenbank\\Dev-Patches\\" | |
db-patches-raw (:db-patches (from-ns-config 'gf.job.project.datenbank.db-patches)) |
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
;; ------------------------------------------------------------------------------------------ some context-oriented-programming-magic | |
(cop/deflayer local-layer) | |
(cop/deflayer net-layer) | |
;; make-writable | |
(cop/deflayered make-writable [& args] (apply du/make-writable args)) | |
(cop/deflayered make-writable net-layer [& args] nil) | |
;; detach | |
(cop/deflayered detach [& args] (apply ad/detach args)) |
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
(ns gitlab.clone-group | |
(:require | |
[cheshire.core :as json] | |
[gitlab.api :refer [get-config]] | |
[babashka.curl :as curl] | |
[clojure.java.io :as io] | |
[clojure.tools.cli :refer [parse-opts]] | |
[babashka.process :refer [$]])) | |
(defn clone-all-repos-from-group [{:keys [gitlab-token gitlab-root group-id local-root]}] |
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
(ns logseq.convert-remote-images-to-local | |
(:require | |
[babashka.fs :as fs] | |
[babashka.curl :as curl] | |
[clojure.java.io :as io] | |
[clojure.string :as str])) | |
;; download remote #logseq media and replace links to point to local assets. | |
;; converting from #logseq web-app to desktop-app. |
OlderNewer