Skip to content

Instantly share code, notes, and snippets.

View Arahnoid's full-sized avatar

Igor Grinchesku Arahnoid

  • Chernivtsi, Ukraine
View GitHub Profile
@Arahnoid
Arahnoid / emacs-image-functions.org
Last active March 12, 2022 20:01
Collection of useful emacs-lisp functions for working with images

Editing images in Markdown files

ig/md-imagemagick-add-shadow

When an image has large bits of white color it may merge with the document background. To avoid this lets add a shadow to the image. We can parse the file path from a image object in Markdown file and send it to ImageMagic.

(defun ig/md-imagemagick-add-shadow ()
  "Add shadow to a Markdown image element"
  (interactive "@*")
@Arahnoid
Arahnoid / config.org
Last active July 25, 2021 09:38
Diabetes.org

Capture

Variables

Define list of variables for org files used for capturing various tasks

(defvar +org-capture-books-file (concat org-directory "books.org")
  "Default, centralized target for org-capture templates.")
(defvar +org-contacts-file (concat org-directory "contacts.org")
  "Org contacts path")
(defvar +org-capture-diabetes-file (concat org-directory "diabetes.org")
  "Capture diabetes related records")
@Arahnoid
Arahnoid / toggle-emphasis.el
Last active December 18, 2020 04:44
A simple function and key binding for Doom Emacs allows to toggle on/of emphasis
(defun my-toggle-emphasis ()
"Toggle emphasis in buffer"
(interactive)
(if (eq org-hide-emphasis-markers t)
(progn
(setq org-hide-emphasis-markers nil)
(font-lock-fontify-buffer)
(message "Emphasis toggled OFF"))
(progn
Debugger entered--Lisp error: (wrong-number-of-arguments quote 3)
(quote (org-mode-map) quote (org-journal-search-mode-map))
(general-define-key :states (quote (normal visual motion emacs insert)) :major-modes t :prefix doom-localleader-key :non-normal-prefix doom-localleader-alt-key :keymaps (quote (org-mode-map) quote (org-journal-search-mode-map)) "n" (function org-journal-search-next) "p" (function org-journal-search-prev))
(progn (general-define-key :states (quote (normal visual motion emacs insert)) :major-modes t :prefix doom-localleader-key :non-normal-prefix doom-localleader-alt-key :keymaps (quote (org-mode-map) quote (org-journal-search-mode-map)) "n" (function org-journal-search-next) "p" (function org-journal-search-prev)) (general-define-key :states (quote (normal visual motion emacs insert)) :major-modes t :prefix doom-localleader-key :non-normal-prefix doom-localleader-alt-key :keymaps (quote (org-mode-map) quote (org-journal-mode-map)) "n" (function org-journal-open-next-entry) "p" (fun
This file has been truncated, but you can view the full file.
# Add this file to your /etc/hosts to block all
# of the ad sites, porn and general junk on this
# list, including Google.
#
# Fell free to add or subtract sites as necessary.
#
# For linux noobs, to add this to /etc/hosts,
# run the following in the same directory of this
# file:
#
@Arahnoid
Arahnoid / ChangeColor.jsx
Last active April 21, 2019 23:01 — forked from theinsanecow/ChangeColor.jsx
[Update shape color] Photoshop script to update the colour of all shape and fill layers that are the same colour as the currently selected layer. Uses the foreground colour as the new colour. Tested in CS4 #Photoshop
// ChangeColor.jsx
//
// This photoshop script finds all shape and solid fill layers that match the color
// of the currently selected shape/fill layer and changes their color to the
// foreground color.
//
// Tested on Adobe Photoshop CS4 (Mac)
// enable double clicking from the Macintosh Finder or the Windows Explorer
#target photoshop
@Arahnoid
Arahnoid / MultiExporter.jsx
Last active April 21, 2019 22:54 — forked from TomByrne/MultiExporter.jsx
[Export from Illustrator]An Illustrator script for exporting layers and/or artboards into separate files (PNG8 / PNG24 / EPS / PDF / SVG / JPG / FXG).See http://www.tbyrne.org/export-illustrator-layers-to-svg-files #Illustrator
// MultiExporter.jsx
// Version 0.1
// Version 0.2 Adds PNG and EPS exports
// Version 0.3 Adds support for exporting at different resolutions
// Version 0.4 Adds support for SVG, changed EPS behaviour to minimise output filesize
// Version 0.5 Fixed cropping issues
// Version 0.6 Added inner padding mode to prevent circular bounds clipping
//
// Copyright 2013 Tom Byrne
// Comments or suggestions to tom@tbyrne.org
@Arahnoid
Arahnoid / psd2png.js
Last active April 21, 2019 22:55 — forked from kikmedia/psd2png.js
[PSD to PNG] Dead simple javascript, providing a basic Photoshop action for exporting PSD files as PNG. Just launch it on your desktop. I think, this one is Windows only. #Photoshop
#target "photoshop"
var outputWidth = 1024;
var inputFolder = Folder.selectDialog("Input folder");
var outputFolder = Folder.selectDialog("Output folder");
if (inputFolder != null && outputFolder != null) {
var files = inputFolder.getFiles("*.psd");
for (var i = 0; i < files.length; i++) {
@Arahnoid
Arahnoid / PhotoshopSpriteStripMaker.js
Last active April 21, 2019 23:00 — forked from wiledal/PhotoshopSpriteStripMaker.js
[Export sprite sheet] Photoshop script for making a sprite sheet out of a folder of images #Photoshop
/* FUNCS */
function move(l,x,y) {
var Position = l.bounds;
Position[0] = x - Position[0];
Position[1] = y - Position[1];
l.translate(-Position[0],-Position[1]);
}
@Arahnoid
Arahnoid / toggleHueSatLayers.js
Last active April 21, 2019 23:00 — forked from Lokno/toggleHueSatLayers.js
[Totle hue/saturation] Toggle the hue and saturation adjustment layers in photoshop #Photoshop
#target photoshop
var currentDoc = app.activeDocument;
for ( var i = 0; i < currentDoc.layers.length; i++ ) {
var layer = currentDoc.layers[i];
if( layer.kind === LayerKind.HUESATURATION )
{
layer.visible = layer.visible ? false : true;
}