Skip to content

Instantly share code, notes, and snippets.

itoshkov / init.el
Created Dec 19, 2018
Change the emacs theme to light or dark variant (GTK+-3)
View init.el
(defun set-emacs-frames (variant)
(dolist (frame (frame-list))
(let* ((window-id (frame-parameter frame 'outer-window-id))
(id (string-to-number window-id))
(cmd (format "xprop -id 0x%x -f _GTK_THEME_VARIANT 8u -set _GTK_THEME_VARIANT \"%s\""
id variant)))
(call-process-shell-command cmd))))
(defun set-emacs-theme-light ()
# Download and install the latest Papirus Icon theme
#set -x
set -e
itoshkov /
Last active Oct 5, 2016
Move images with certain size to directory
identify -format "%wx%h,%f\n" * | grep '^1920x1080,' | colrm 1 10 | while read f; do mv "$f" /tmp/t; done
curl -d @recipe.json -H "Content-Type: application/json" "${YOUR_APP_ID}&app_key=${YOUR_APP_KEY}"
itoshkov / nutritions.json
Last active Dec 28, 2015
Abridged nutritional info. JSON format doesn't support comments, so I used "..." instead.
View nutritions.json
"uri" : "",
"yield" : 15.0,
"calories" : 21814,
"dietLabels" : [ "LOW_CARB" ],
"cautions" : [ ],
"totalNutrients" : {
"label" : "Energy",
View recipe.json
"title": "Fresh Ham Roasted With Rye Bread and Dried Fruit Stuffing",
"prep": "1. Have your butcher bone and butterfly the ham and score the fat in a diamond pattern. ...",
"yield": "About 15 servings",
"ingr": [
"1 fresh ham, about 18 pounds, prepared by your butcher (See Step 1)",
"7 cloves garlic, minced",
"1 tablespoon caraway seeds, crushed",
"4 teaspoons salt",
"Freshly ground pepper to taste",
import static moulder.moulds.Moulds.append;
import static moulder.moulds.Moulds.attr;
import static moulder.moulds.Moulds.forEach;
import static moulder.moulds.Moulds.text;
import static moulder.values.Values.seq;
import java.util.Arrays;
import java.util.List;
import moulder.MoulderShop;
itoshkov / toggle-earmuffs.el
Created Nov 22, 2011
Emacs lisp toggle-earmuffs
View toggle-earmuffs.el
(defun toggle-earmuffs ()
"Add or remove earmuffs (asterisks at front and end) of
(let* ((saved-point (point))
(variable (thing-at-point 'symbol))
(bounds (bounds-of-thing-at-point 'symbol))
(len (- (cdr bounds) (car bounds)))
(start-char (elt variable 0))