Skip to content

Instantly share code, notes, and snippets.

View briang's full-sized avatar

brian greenfield briang

  • Newcastle, UK
View GitHub Profile
@briang
briang / perlbrew in opt.md
Last active September 15, 2022 09:29
A shared perlbrew root for multiple users (perlbrew in /opt)

A shared perlbrew root for multiple users

作者:gugod 發佈於:2010/12/07 https://gugod.org/2010/12/a-shared-perlbrew-root-for-multiple-users/

Perhaps the biggest advantage of using perlbrew 0.15, is the possibility to share one perlbrew root among multiple users, assuming everyone uses bash (or zsh, which is compatible to bash.)

Let's assume the following scenario:

  • the global perlbrew is located at /opt/perlbrew
  • a user named perlbrew has write permission, and can install new perls and modules
  • all other users have read-only access
@briang
briang / emacs-28-builder.sh
Last active May 31, 2022 10:41
Emacs 28 compilation script for debian 11
#!/bin/bash
set -o errexit # exit on error
set -o pipefail # trap pipe fails
set -o nounset # trap unset vars
DEST="/usr/local"
SOURCE="$HOME/emacs-28.1"
NATIVE_FULL_AOT='' # 'NATIVE_FULL_AOT=1' # removed in emacs 28.1
JOBS='-j 3'
@briang
briang / compile-emacs
Last active October 25, 2021 13:29
semi-automated emacs native-comp compiler & installer
#!/bin/bash
set -e # exit on error
GCC_VER=$(gcc -dumpversion)
sudo apt install \
autoconf \
automake \
build-essential \
@briang
briang / gist:439908f66fd0387fc86ebbfa0763ce6b
Created August 12, 2021 14:06
run-perl-on-current-buffer-file
(define-derived-mode run-mode
special-mode "Run"
"help!!!"
:init-value nil)
(defun run-perl-on-current-buffer-file ()
(interactive)
(save-buffer)
(setq filename (buffer-file-name (current-buffer)))
(delete-other-windows)
@briang
briang / p-list.el
Created May 29, 2021 11:49
searching a p-list
(setq plistlist '( (:number 1 :name "one")
(:number 2 :name "two") ))
(setq result (seq-find (lambda (elt)
(eq (plist-get elt :number) 2) )
plistlist) )
(message "%s" result)
@briang
briang / reset-windows-icon-cache.bat
Created February 9, 2018 10:04
reset windows 7 icon cache without rebooting
REM Based on https://superuser.com/questions/499078/refresh-icon-cache-without-rebooting
taskkill /IM explorer.exe /F
DEL %userprofile%\AppData\Local\IconCache.db /a
start explorer
pause
@briang
briang / README.md
Last active August 29, 2015 14:12
README for Dist::Zilla distributions on GitHub

This distribution is managed using Dist::Zilla. If all you want to do is to install the latest stable distribution of {{dist}}, your best bet is to install it from CPAN using your usual CPAN client:

$ cpanm {{dist}} # cpan or cpanp also work

If you want to install this GitHub version of the distribution you need to have an up-to-date installation of Dist::Zilla. This is more complicated than installing direct from CPAN.

Packages, Modules and Distributions

First, module dependencies are declared using a package, not a distribution. If your application uses LWP::UserAgent, you have to declare:

requires 'LWP::UserAgent' => '5.20'; # Known minimum version of the module

instead of "libwww-perl" "5.20".