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
;;; wombat-theme.el --- Custom face theme for Emacs -*- lexical-binding:t -*- | |
;; Copyright (C) 2011-2023 Free Software Foundation, Inc. | |
;; Author: Kristoffer Grönlund <[email protected]> | |
;; This file is part of GNU Emacs. | |
;; GNU Emacs is free software: you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by |
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 'svg) | |
(defun replace-text (start end) | |
(interactive "r") | |
(let* ((str (buffer-substring start end)) | |
(scale (cadr (assoc :height (assoc 'default face-remapping-alist)))) | |
(width (float (car (window-text-pixel-size nil start end)))) | |
(height (float (cdr (window-text-pixel-size nil start end)))) | |
(family (face-attribute 'default :family)) | |
(ascent (* (aref (font-info family) 8) (if scale scale 1))) | |
(img (format "<?xml version='1.0' encoding='UTF-8'?> |
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
;; Score out this text | |
(require 'svg) | |
(defun replace-text (start end) | |
(let* ((str (buffer-substring start end)) | |
(scale (cadr (assoc :height (assoc 'default face-remapping-alist)))) | |
(family (face-attribute 'default :family)) | |
(height (* (aref (font-info family) 2) (if scale scale 1))) | |
(ascent (* (aref (font-info family) 8) (if scale scale 1))) | |
(img (svg-create (car (window-text-pixel-size nil start end)) |
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
;; Provided by Sebastian Urban | |
;; More information at https://idiocy.org/emacs-fonts-and-fontsets.html | |
(set-fontset-font "fontset-default" 'adlam "Noto Sans Adlam") | |
(set-fontset-font "fontset-default" 'anatolian "Noto Sans Anatolian Hieroglyphs") | |
(set-fontset-font "fontset-default" 'arabic "Noto Sans Arabic") | |
(set-fontset-font "fontset-default" 'aramaic "Noto Sans Imperial Aramaic Regular") | |
(set-fontset-font "fontset-default" 'armenian "Noto Sans Armenian") | |
(set-fontset-font "fontset-default" 'avestan "Noto Sans Avestan") | |
(set-fontset-font "fontset-default" 'balinese "Noto Sans Balinese") |
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
DECLARE @source nvarchar(256), | |
@destination nvarchar(256) | |
SET @source = 'X:\Websense SQL\MSSQL10_50.WEBSENSEWSG\MSSQL\DATA\' | |
SET @destination = 'C:\ClusterStorage\DBstore1\MSSQL12.WEBSENSEWSG\MSSQL\DATA\' | |
SELECT DISTINCT 'RESTORE DATABASE ' + database_name + | |
' FROM DISK = ''' + physical_device_name + ''''+ | |
' WITH RECOVERY,' + | |
' MOVE ''' + datafile.logical_name + '''' + |
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
"use strict"; | |
function lexer(input) { | |
let pos = 0 | |
/* A couple of functions to help us grab the characters. */ | |
function next() { | |
if (pos < input.length) { | |
return input.charAt(pos++) | |
} |
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
;;; unichar-mode --- Insert correct unicode characters | |
;;; Copyright (C) Alan Third 2015 | |
;; Author: Alan Third <[email protected]> | |
;; Created: 21 Nov 2015 | |
;; Homepage: https://gist.github.com/alanthird/b758d3fb45b0e863f8a4 | |
;; Version: 1.0 |
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
;; Bind all the greek letters with the prefix C-c g. So, for example | |
;; C-c ga inserts α and C-c gOME inserts Ω | |
(defun at/global-bind-alist (prefix alist) | |
(mapc | |
(lambda (p) | |
(global-set-key (kbd (concat prefix (car p))) (cdr p))) | |
alist)) | |
(at/global-bind-alist "C-c g" |
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
function millerRabin(n) { | |
function isOdd(n) { | |
return n%2===1; | |
} | |
function rnd(floor, ceil) { | |
return floor+Math.floor(Math.random()*(ceil-floor)); | |
} | |
function expmod(base, exponent, mod) { |