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 / kill-ring-save-and-osx-clipboard.el
Last active Oct 22, 2015
Just a bit of emacs lisp that maps both `kill-ring-save' and `simpleclip-copy' to M-w
View kill-ring-save-and-osx-clipboard.el
(require 'simpleclip)
(simpleclip-mode 1)
(define-key global-map (kbd "M-w")
(defun kill-save-copy-to-clipboard ()
"The function kill-save-copy-to-clipboard uses `simpleclip-mode' to
kill-ring-save and copy to osx clipboard using a common shortcut."
(interactive)
(if (use-region-p)
(kill-ring-save (region-beginning) (region-end)
(simpleclip-copy (region-beginning) (region-end))))))
@paxperscientiam
paxperscientiam / kill-and-copy-expression-result.el
Last active Oct 22, 2015
Kill and copy an expression result.
View kill-and-copy-expression-result.el
(define-key global-map (kbd "C-x C-j")
(defun kill-copy-eval-sexp (arg)
"The function `kill-copy-eval-sexp' kill-saves and copies an
expression result using `simpleclip-mode'."
(interactive "P")
(set-register ?1 (format "%s"(eval-last-sexp arg)))
(simpleclip-set-contents (get-register ?1))
(kill-new (get-register ?1))
))
@paxperscientiam
paxperscientiam / gulp-conditional-depends.js
Created Oct 27, 2015
// Execute task dependencies conditionally!
View gulp-conditional-depends.js
// requires and what not
// Execute task dependencies conditionally!
var conditional = true;
var jk = (conditional) ? ['b']:null;
gulp.task('a', jk, function() {
"use strict";
console.log("THIS IS A");
});
@paxperscientiam
paxperscientiam / EGUTF8.bas
Created Nov 5, 2015
Quite possibly the only way to export UTF8 formatted data from Excel 2011!
View EGUTF8.bas
'Refer to execShell() by Robert Knight
' Or, to the StackOverflow post by Robert Knight if it still exists: https://stackoverflow.com/questions/6136798/vba-shell-function-in-office-2011-for-mac
' OMFGBBQ IT WORKS!
rngSomeRange.copy
scriptToRun = "export LC_ALL=en_US.UTF-8 && " & _
"touch " & sOutFolder & "/" & sOutFile & ".tex && " & _
"pbpaste > " & sOutFolder & "/" & sOutFile & ".tex"
@paxperscientiam
paxperscientiam / UDF_NearestInteger.bas
Created Nov 5, 2015
An Excel VBA UDF to round a decimal number to the nearest integer.
View UDF_NearestInteger.bas
Function getRoundInteger(num As Double) As Double
Const BUG As Boolean = 1
Dim er As Integer: er = 0
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' getRoundInteger( ) v.1.0
' Function getRoundInteger( ) takes a double and uses the "rounds half up" method (towards +∞) to get the nearest "integer".
' The error stuff was just an experiment that will get it's on follow up.
' Works pretty well, though use at your own discretion!
' ~ Pax Per Scientiam
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
@paxperscientiam
paxperscientiam / ComputeRelativeRowsExcel.txt
Last active Nov 5, 2015
A review of various ways to determine relative row numbers in Excel
View ComputeRelativeRowsExcel.txt
# v. 1.0
# Originally posted here: https://www.reddit.com/r/excel/comments/339gw7/discussion_simplest_possible_way_to_get_this/
# Use at your own discretion.
# Pax Per Scientiam
This is pretty much ripped directly from a posting I made on Reddit. I'm putting it here for posterity. Please note that I'm using the Excel 2011 (Mac) version of structured reference syntax, which I think is a bit different than that of Excel 2013 (Windows).
I've long wondered if there were a simpler way to get the relative row number of an Excel Table.
This has been my usual go to (refers to some table called "Table1" and some column therein called "column1"),which is entered into column1:
@paxperscientiam
paxperscientiam / kill-expression-result.el
Last active Nov 11, 2015
Kill emacs list expression result.
View kill-expression-result.el
;; props to #emacs
(define-key global-map (kbd "C-x C-j")
(lambda (arg)
"RTM"
(interactive "P")
(kill-new (format "%s" (eval-last-sexp arg)))))
@paxperscientiam
paxperscientiam / runLBLL.engine
Last active Dec 24, 2015
TeXShop Engine for maintaining a sweet directory structure and LaTeX'ing and BibTeX'ing the correct number of times.
View runLBLL.engine
#!/opt/local/bin/bash
# WARNING -- AT ANY GIVEN TIME, THIS SCRIPT MAY NOT WORK DO TO CONSTANT UPDATES -- USE AT YOUR OWN PERIL!
## Added stand-alone support; may be used from the command line and from any directory.
## Added support for multiple image types
## Streamlined code to ensure minimal file shuffling.
## Corrected problem of TeXShop not auto-opening final .pdf product.
# runLBLL.engine is an .engine file for TeXShop and should be stored in ~/Library/TeXShop/Engine -- be sure to restart TeXShop
# You could store your .bib and .bst files in the /Misc directory or use TeXLive's ~/Library/texmf/bibtex/bib and ~/Library/texmf/bibtex/bib/bst, respectively, for global access
# This script will LaTeX-->BibTeX-->LaTeX-->LaTeX
# Credit:
@paxperscientiam
paxperscientiam / CDPathExpand
Last active Mar 2, 2016
Demonstration of how braces expansion can be used to shorten $PATH string.
View CDPathExpand
# Version 1.0
# Pax Per Scientiam
# Bash "brace expansion" can be used to compactify long lists of paths.
# I've come up with some basic syntax rules to demonstrate this.
# For the simplest directory structure (i.e. /x00{,/x10{,/x20{,/x30}}}, the expansion result is...
# input>
CDPATH=`printf %s\\: /x00{,/x10{,/x20{,/x30}}}` && echo $CDPATH
# output> /x00:/x00/x10:/x00/x10/x20:/x00/x10/x20/x30:
@paxperscientiam
paxperscientiam / createjson.php
Last active Apr 7, 2016
JSON manifest of HTML <img/> "src" and "alt" atributes
View createjson.php
<?PHP function fileListJSON($small,$big,$outJSON) {
$outJSON = $outJSON;
// Sort the files alphanumerically, naturally. (thumbs)
if ($handle = opendir($small)) {
$files = array();
while ($files[] = readdir($handle));
sort($files,SORT_NATURAL);
You can’t perform that action at this time.