Skip to content

Instantly share code, notes, and snippets.

💭
For hire

Chris paxperscientiam

💭
For hire
Block or report user

Report or block paxperscientiam

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@paxperscientiam
paxperscientiam / tmux-xpanes-implementation-example.bash
Created Feb 14, 2020
tmux-xpanes-implementation-example.bash
View tmux-xpanes-implementation-example.bash
#!/usr/bin/env bash
unset CDPATH
PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/opt/local/bin
function title ()
{
echo -ne "\033]0;"$*"\007"
View req.js
const path = require('path');
function Req(base) {
this.base = base;
}
Req.prototype.get = function(module, opts) {
if (typeof require(path.resolve(this.base, module)) === 'function' && opts !== undefined) {
return require(path.resolve(this.base, module))(opts)
} else {
View demo.gif
GIF89aYw!ÿ NETSCAPE2.0!ù9,Y‡

     +!.4&%$)!*#.16" 5&;4:2*(#(,4+2)$894+#3.293(3325D%:C0,B7<D87U)B;>B.9C;8Q?+CG,FS8FK;IR8QK:SV;TcBJ+A-"E8(D<4T;&S>2k7i<#C9@NMJB+HD8OX$JQ;WE)UH8XY%ZT:WeZc*oBkS5pj7GHFCLTKRJITYTLERNSWUHTZZHKjJYbF[pT\bV[vZb[KdgLfrZcdWjtYqm[sxfZJb^eidIgeXlp[yhGujWzuGzsYeigflqkqkjttsldslpvuivzv[r‚gmƒhy„j}•w|„u}™vx¡|€;~D{yjƒˆlˆ—z„…uŠ—y’Žx’šz—®} ¹=ƒ=!ƒD‹R*Ži8¢\*¯l2…\AˆuR†zk§zKÇz7€~…„<±>•…Y‰ƒh‡…xŽ’{˜‡e•Šwœ“f™’y§[¬•j¸¢[¸£r΅;͓KŜlÓ§Pɬvç°Uå³oØÌ\ÛÃxïÎ_éÌrùí{‡‰…‡Œ•Œ‘‰‰”–”Œƒ“Ž“–•ˆ—™–ƒ‹¨…›ªƒ³”œ¦•žºŒ¡›› ‹œ¡™Š¡¬ˆ£·™¤¨”¨·™°¹¥›ˆ¨¢Š§¥—­°›·§‡²¬˜»±‰¸²›§©¦¤«´«²¨¨µ¸²­¤±®º¶¶¨·¸¶®Ã¢¨Âª¹Ä©¼Ô³¼Ä±»Ó»Á¹žÂÑ«Â̧ÇÖ®ÑÛ¶ÆɸÊÔ¼ÑÉ»ÑÙ¶Ûé½áíζˆÂ¼©å»‡ØÎËǵÝä¸é̐éدóæ”õé´ÈÉÆÄÍÓÌÒÊÅÕÛÑÎÄÓÎÑÖÕÉÜÜÛÌÛâÚâØÆæíÈéòÎðôØåæÑíòÐðïÔñôâÜÍâÞáïíÓååååíðêòëêóòðîåðîò÷÷éôôôÿñ H° Áƒ*\È°¡Ã‡#JœH±¢Å‹3jÜȑà¿A~Ä÷Qdɓ(Sª\ɲ¥Ë—0cʜI³¦Í›8sêÜɳ§ÏŸ@ƒ
View moose-tooltip.scss
@mixin moose-tooltip($message) {
position: relative;
display: inline-block;
text-decoration: underline dotted blue;
&::before {
opacity: 0;
}
&:hover::before {
opacity: 1;
font-size: 0.8rem;
@paxperscientiam
paxperscientiam / promises.md
Created May 24, 2019 — forked from domenic/promises.md
You're Missing the Point of Promises
View promises.md

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
    // the rest of your code goes here.
View moose-functions.el
(defun dsedivec/called-via-key-binding (cmd)
"Returns non-nil if `this-command-keys' is bound to CMD."
(eq (key-binding (this-command-keys)) cmd))
(defun moose/popup-count-words-region (start end)
"Get word count for positive length active region."
(interactive "r")
(cond ((and (use-region-p)
(dsedivec/called-via-key-binding #'moose/popup-count-words-region))
View moost-test.el
(defun moose/popup-count-words-region (start end &optional args)
"Get word count for positive length active region."
(interactive "r\np")
(cond ((and (use-region-p)
(eq this-command 'moose/popup-count-words-region))
(let ((print-escape-newlines t))
(popup-tip (concat (number-to-string (count-words start end)) " words"))))))
View moost-test.el
(defun moose/popup-count-words-region (start end)
"Get word count for positive length active region."
(interactive "r")
(cond ((and (use-region-p)
(> (region-end) (region-beginning))
(eq this-command 'moose/popup-count-words-region))
(let ((print-escape-newlines t))
(popup-tip (concat (number-to-string (count-words start end)) " words"))))))
View compile-make.el
;; all credit to someone else. use are your own peril!
;; search the closest Makefile and run make
;; not finished
;; 从当前目录向上查找最近的Makefile,并执行make命令
(defun get-parent-directory (path)
"get the parent directory"
(file-name-directory (directory-file-name path)))
View moose-functions.el
(defun moose/test-compilation-buffer (buffer string)
"Return messages of success."
(if (and
(string-match "compilation" (buffer-name buffer))
(string-match "finished" string)
(not (search-forward "warning" nil t)))
(message "Compilation successful.")
(message "FAIL!")))
You can’t perform that action at this time.