Skip to content

Instantly share code, notes, and snippets.

(defn- attach
"Takes a function to clone and a map of CSF related values
including:
- :args
- :arg-types
- :parameters
These are then properly named and assigned to the template prototype
@jhacksworth
jhacksworth / markdown-with-xwidget-webkit.md
Created September 3, 2020 00:43
Doom Emacs: Markdown live preview with xwidget-webkit

Doom Emacs: Markdown live preview with xwidget-webkit

I saw that there's a markdown-live-preview-mode and the var markdown-live-preview-window-function which was set to the function markdown-live-preview-window-eww. That function looks like this:

(defun markdown-live-preview-window-eww (file)
  "Preview FILE with eww.
To be used with `markdown-live-preview-window-function'."
;;; -*- lexical-binding: t; -*-
(defun doom--resolve-hooks (hooks)
(cl-loop with quoted-p = (eq (car-safe hooks) 'quote)
for hook in (doom-enlist (doom-unquote hooks))
if (eq (car-safe hook) 'quote)
collect (cadr hook)
else if quoted-p
collect hook
else collect (intern (format "%s-hook" (symbol-name hook)))))
/**************************************************************************************************************
MAPPING
- First CSS class name is the name of the Emacs atom-one-dark theme color
variable
- Second CSS class name is either:
- the name of the Atom One Dark source variable OR
- a comment about how the value is obtained
@jhacksworth
jhacksworth / atom-one-dark-to-emacs.less
Last active January 31, 2018 22:06
A mapping of Atom "One Dark" theme colors to Emacs "atom-one-dark" theme. Example output: https://gist.github.com/jhacksworth/e7efbe1a5cfe53abfe7619a3cdbf0f07
// # What is this?
//
// A mapping of Atom "One Dark" theme colors to Emacs "atom-one-dark" theme
// colors. Use this file with the LESS compiler to output colors in hex.
//
// # How do I use this?
//
// - Copy & Paste this file into the "LESS" column on this page: http://lesscss.org/less-preview/
//
// OR
@jhacksworth
jhacksworth / gist:3c4ccd576f9a9f9c2ca8
Created December 1, 2015 19:24 — forked from jagregory/gist:710671
How to move to a fork after cloning
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork git@github...my-fork.git
#!/usr/bin/perl
# This script was no no longer online, so I snagged it from archive.org at
# http://web.archive.org/web/20051216235430/http://ant.home.comcast.net/colorize/colorize-pod.html
#
# colorize-0.0.3.pl - Colorize messages, nicks in message text, or both.
#
# Usage: see the POD at the end of this file or type '/colorize ?' in Xchat.
#
# To customize the brackets that surround the sending nick, e.g. <nick>,
@jhacksworth
jhacksworth / .gitignore
Last active August 29, 2015 13:57 — forked from adamgit/.gitignore
#########################
# .gitignore file for Xcode5 / OS X Source projects
#
# Version 2.1
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2014 updates:
# - ignore Xcode 5 source control files
# - Ignore `Pods` folder
#
@jhacksworth
jhacksworth / scratch.vim
Created April 26, 2011 17:30 — forked from pelletier/scratch.vim
Add ScratchToggle to scratch.vim
" File: scratch.vim
" Author: Yegappan Lakshmanan (yegappan AT yahoo DOT com)
" Version: 1.1
" Last Modified: April 26, 2011
" Modified By: Thomas Pelletier (thomas AT pelletier DOT im)
"
" Changes
" -------
" Added the ScratchToggle command.
"