Skip to content

Instantly share code, notes, and snippets.

@theanalyst
theanalyst / The Repo Less Forked.md
Last active October 13, 2015 23:08
The Repo Less Forked

The Repo Less Forked

An attempt at a parody on git and Github, a non-sensical fork of the Road Less Taken by Robert Frost, fork with care and a tribute to Git and GitHub

Two forks diverged in an open repo,
And sorry I could not commit both
And be one follower, long I stood
And watched one as far as I could
To where it diverged in the fork;

Then forked the other, as just as fair,

@theanalyst
theanalyst / remove-nonprint-ascii.el
Last active December 11, 2015 20:48
Removes non printable (possibly control characters) in files
(defun remove-non-print-ascii()
"Remove non printable ascii characters from buffer"
(interactive)
(save-match-data
(save-excursion
(goto-char (point-min))
(while (re-search-forward "[^ -~\n]" (point-max) t)
(replace-match "" nil nil))
(message "Removed non-printable ascii chars"))))
# name: doxy
# key: doxy
# --
/**
\brief $0
\param[in] $1
\return $2
\retval $3
from xkcdplot import XKCDify
import numpy as np
import pylab
import scipy.stats
import matplotlib.pyplot as plt
ax = pylab.axes()
x = np.linspace(0,5,100)
y = np.linspace(0,np.pi/2,100)
ax.plot(x,scipy.stats.norm.pdf(x,0,1),'r',lw=1,label="productivity")
@theanalyst
theanalyst / invisible-frames.el
Created April 21, 2013 07:00
Bring up invisible frames
(dolist (frame (frame-list))
(unless (frame-visible-p frame)
(make-frame-visible frame)))
@theanalyst
theanalyst / winemacs-pref.el
Last active December 20, 2015 02:59
Some emacs preferences to work in windows
;; Some emacs preferences to work with windows
;; If you want to follow doctor's advice use Linux :)
(defun run-bash ()
"Runs a bash shell in windows emacs in a buffer called *bash*,
multiple instances are allowed. M-x shell still launches cmd.
Otherwise this can be directly acheived by pointing
`explicit-shell-name' to your shell.
Here I'm using Msys Git's bash, which was already in PATH.
@theanalyst
theanalyst / pushbullet.el
Last active January 28, 2019 01:20
Easily push from your emacs to Android phone??
;;; pushbullet.el --- An emacs client for the pushbullet android app
;;; Using the pushbullet api at https://pushbullet.com/api
;;; Uses grapnel for http requests https://github.com/leathekd/grapnel
;;;
;;; Commentary:
;;;
;;; Code:
(require 'grapnel)
(require 'json)
@theanalyst
theanalyst / elix.el
Last active December 23, 2015 12:09
(require 'grapnel)
(require 'json)
(defgroup elix nil
"Elix -- Emacs ix.io client"
:tag "Elix"
:group 'tools)
(defcustom ix-user nil
"user name for posting at http://ix.io"
@theanalyst
theanalyst / das.hy
Last active December 28, 2015 05:59
An attempt at writing some sequence utils in hy (heavily inspired by dash.el)
(defmacro inc! [var]
`(setv ~var (inc ~var)))
(defmacro --dotimes [n &rest body]
"Anaphoric form of dotimes; allows `it' to be used in the body for
eg. (--dotimes 10 (print it))"
`(let [[it 0]]
(while (< it ~n)
~@body
(inc! it))))
@theanalyst
theanalyst / Heels.rst
Last active December 30, 2015 04:08
Living the high style

The Hy Style Guide

“You know, Minister, I disagree with Dumbledore on many counts…but you cannot deny he’s got style…” — Phineas Nigellus Black, Harry Potter & the Order of the Phoenix

The Hy style guide intends to be a set of ground rules for the Hyve (yes, the Hy community prides itself in appending Hy to everything) to write idiomatic Hy code. Hy derives a lot from Clojure & Common