Skip to content

Instantly share code, notes, and snippets.

View yveszoundi's full-sized avatar

Yves Zoundi yveszoundi

View GitHub Profile
@yveszoundi
yveszoundi / AlignSpread.ajs
Created May 10, 2024 12:01
#jArchi script to align and spread components
// Author: Yves Zoundi
// Requires: jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
// Purpose: Align to lowest, spread the selected elements horizontally or vertically
// Date: 2024-05-10
// Version 0.0.1
// Change: Initial version based on similar previous jArchi scripts on GitHub
console.clear()
console.show()
console.log("START: AlignSpread")
@yveszoundi
yveszoundi / ImportSpecializations.ajs
Created April 26, 2024 23:25
#jArchi script to import specializations from properties file
/*
Author: Yves Zoundi
Description: Import specializations and applicable icons
- Assumptions
- Folder with containing your specialization icons and a mapping file 'mapping.properties'
- Icon files are derived automatically from your specialization names (in lowercase)
- Supported icon file names: .png, .jpg, .jpeg, .gif, .tif, .tiff, .bmp, .ico
- The icon file name is derived automatically via the following approach:
- For a specialization 'Custom Location' will attempt loading icons with the name 'custom-location' (spaces to dashes)
@yveszoundi
yveszoundi / DumpArchimateViewElementTypes.ajs
Created April 26, 2024 22:57
#jArchi script to dump Archimate View element types
// Author: Yves Zoundi
// Dump Archimate View element types for either elements or relationships
// This can be useful for custom coloring, custom import/export etc.
console.show()
console.clear()
console.log("START: DumpArchimateViewElementTypes")
let selection = window.promptSelection("Choose types to dump", ["Element Types", "Relationship Types"] )
@yveszoundi
yveszoundi / brew_install_spice.sh
Created February 6, 2022 03:29
Homebrew installation command for custom spice formula
CMAKE_CXX_STANDARD=11 CFLAGS=-Wno-error CMAKE_TESTING_ENABLED=false ENABLE_TESTS=false ENABLE_TESTING=false BUILD_TESTING=false brew install -v spice
@yveszoundi
yveszoundi / spice.rb
Created February 6, 2022 03:27
MacOS spice homebrew formula
class Spice < Formula
homepage "https://www.spice-space.org/"
url "https://gitlab.freedesktop.org/spice/spice.git"
version "master"
depends_on "autoconf" => :build
depends_on "autoconf-archive" => :build
depends_on "autogen" => :build
depends_on "automake" => :build
depends_on "gobject-introspection" => :build
@yveszoundi
yveszoundi / qemu.rb
Created February 6, 2022 03:24
MacOS QEMU homebrew formula with spice support
class Qemu < Formula
desc "Emulator for x86 and PowerPC"
homepage "https://www.qemu.org/"
url "https://download.qemu.org/qemu-6.2.0.tar.xz"
sha256 "68e15d8e45ac56326e0b9a4afa8b49a3dfe8aba3488221d098c84698bca65b45"
license "GPL-2.0-only"
head "https://git.qemu.org/git/qemu.git", branch: "master"
bottle do
sha256 arm64_monterey: "57ffc7f97cbd053121f7767f08c2386beac29ef8efa7f93398d347b24d979621"
@yveszoundi
yveszoundi / paste-c-net.el
Last active December 20, 2021 22:52
Create a paste at paste-c-net.org
(defvar paste-c-net-url "https://paste.c-net.org/")
(defvar paste-c-net-buffer-name "*paste-c-net*")
(defun paste-c-net--buffer-whole-string (buffer)
"Retrieve the text contents from an HTTP response BUFFER."
(with-current-buffer buffer
(save-restriction
(widen)
(re-search-forward "^$")
(buffer-substring-no-properties (point) (point-max)))))
@yveszoundi
yveszoundi / newtype.el
Created June 30, 2016 12:37
Eclim New Type
(defun ers/eclim-new-type (new_type_name new_type)
(interactive (list (read-string "Type name: ")
(completing-read "Type: " '("class"
"abstract"
"interface"
"enum"
"@interface"))))
(let* ((prj-dir (or (eclim-project-name) (eclim-project-name (dired-current-directory))))
(eclim-newtype-args (list "java_new"
"-p"
@yveszoundi
yveszoundi / eclim-format-region-or-buffer.el
Created June 27, 2016 11:29
Eclim format region or buffer
(defun eclim-java-format ()
"Format the source code of the current java source file."
(interactive)
(let ((positions (if (region-active-p)
(list (region-beginning) (region-end))
(list 0 (1- (point-max))))))
(eclim/execute-command "java_format" "-p" "-f" ("-h" (car positions)) ("-t" (cadr positions) ) "-e")))
@yveszoundi
yveszoundi / jump-to-file-register.el
Last active January 17, 2016 16:32
ELISP-Jump easily to a file register using completing-read (default, IDO or Helm)
(defun jump-to-file-register ()
"Jump to a file register using completing-read"
(interactive)
(let* ((reg-list (cl-loop for ptr-reg in register-alist
when (eq 'file (first (last ptr-reg)))
collect (concat (char-to-string (car ptr-reg)) "|" (cdr (last ptr-reg)))))
(reg-data (completing-read "Pick file register: " reg-list))
(reg-location (string-to-char (car (split-string reg-data "|")))))
(jump-to-register reg-location)))