Skip to content

Instantly share code, notes, and snippets.

View dhaley's full-sized avatar

Damon Haley dhaley

  • National Renewable Energy Laboratory
  • Lafayette, CO
View GitHub Profile
@10long
10long / geeknote.el
Created February 17, 2014 03:39
geeknote call inside emacs
;; geeknote ==============================================================
(defun geeknote-mode ()
(interactive)
(eshell-command "python ~/geeknote/geeknote.py settings --editor /Applications/Emacs.app/Contents/MacOS/bin/emacsclient")
)
(defun geeknote-create (newnote)
(interactive "sname: ")
(eshell-command
(format "python ~/geeknote/geeknote.py create --content WRITE --title %s" newnote))
@ShingoFukuyama
ShingoFukuyama / emacs mac osx say
Last active November 5, 2018 12:50
Utilizing `say' command which Mac OSX has for Emacs.Region lines and then `M-x osx-say' to make OSX speak.
;; Region lines and then `M-x osx-say' to make OSX speak.
;; Adjust speak speed
(setq osx-say-speed 180)
;; Change voice
;; Kathy, Vicki, Victoria, Alex, Bruce, Fred
(setq osx-say-voice "Alex")
(setq osx-say-buffer "*osx say*")
@yasuyk
yasuyk / open-os-x-terminal-on-edit-server-start.el
Last active December 28, 2015 00:39
Focus Emacs(emacs -nw) on OS X Terminal.app with "Edit with Emacs".
(when (and (eq system-type 'darwin) (eq window-system nil))
(defun open-os-x-terminal ()
(shell-command "open -a /Applications/Utilities/Terminal.app"))
(add-hook 'edit-server-start-hook 'open-os-x-terminal))
@Sodaware
Sodaware / phing-call.el
Created November 8, 2013 17:44
Call a phing build target from within Emacs. Will use the build.xml in the directory of the current file. If no build.xml is found, it will search in the directories above until one is found. Base on Ant Call: http://www.emacswiki.org/emacs-en/AntCall
(defun phing-call (target)
"Call Phing's build.xml"
;; Ask for target to execute
(interactive "MPhing Target: ")
;; Open a new *phing-compilation* buffer & kill the old one
(let ((oldbuf (get-buffer "*phing-compilation*")))
(if (not (null oldbuf))
(kill-buffer "*phing-compilation*")))
@calmyournerves
calmyournerves / building_git-annex_on_osx_mavericks.sh
Last active August 13, 2023 20:51
Building git-annex on OS X 10.9 Mavericks
# make sure the following is installed:
# - Xcode Command Line Tools (xcode-select --install)
# - OpenSSL from homebrew (brew install openssl && brew link openssl --force)
# dependencies and preparations
brew update
brew install git ossp-uuid md5sha1sum coreutils pcre gnutls libidn gsasl pkg-config libxml2
brew link libxml2 --force
brew tap darinmorrison/haskell
brew install darinmorrison/haskell/cabal-install
@sabof
sabof / gist:6201962
Last active December 20, 2015 21:59
es-scrape-web-listing
;; -*- lexical-binding: t -*-
(require 'cl-lib)
(defun es-scrape-web-listing
(start-url collect-function next-url-function done-function
&optional pages-limit silent)
"Retrieve a list of things from a multi-page web document.
START-URL is the location from which to start scraping.
@jhedstrom
jhedstrom / FeatureContext.php
Last active April 5, 2019 10:25
Step-definition for complex node structure (field collection + entity reference).
<?php
/**
* @Given /^I am viewing a product with the following related products:$/
*/
public function assertRelatedProducts(TableNode $relatedProducts) {
// First, create a product.
$product = (object) array(
'title' => 'Parent Product',
'type' => 'product',
'uid' => 1,
@syohex
syohex / git-ls-directories.el
Last active December 17, 2015 02:39
Show directories in git repository
(require 'cl)
(defun git-repository-root ()
(with-temp-buffer
(let* ((cmd "git rev-parse --show-toplevel")
(ret (call-process-shell-command cmd nil t)))
(unless (zerop ret)
(error "Here is not Git repository"))
(goto-char (point-min))
(buffer-substring-no-properties
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC
"-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.mxcl.bitlbee</string>
<key>ProgramArguments</key>
<array>
@ck-on
ck-on / ocp.php
Last active May 18, 2024 22:35
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter