Skip to content

Instantly share code, notes, and snippets.

View airstrike's full-sized avatar
🎯
bringing presentations and spreadsheets to the 21st century

Andy Terra airstrike

🎯
bringing presentations and spreadsheets to the 21st century
View GitHub Profile
@airstrike
airstrike / .vimrc
Last active October 13, 2020 03:39
Latest vimrc file (2019)
" VIM user interface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set so=2 " Show at least 2 lines around cursors when moving vertically
set ruler "Always show current position
set cmdheight=1 "The commandbar height
" Set backspace config
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
#========================================================================
# Description: Tokenise an Excel formula using an implementation of
# E. W. Bachtal's algorithm, found here:
#
# Blog post: https://ewbi.blogs.com/develops/2004/12/excel_formula_p.html
# See also: https://ewbi.blogs.com/develops/popular/excelformulaparsing.html
# Direct link to this port: http://www.ewbi.com/ewbi.develop/samples/jsport_nonEAT.py
#
# Originally written for Python v2.5 (win32)
# Author: Robin Macharg
@airstrike
airstrike / anne.ahk
Created July 25, 2018 20:56
Anne Pro AutoHotkey (AHK) Script
SetCapsLockState, AlwaysOff
; The above lets you use hotkeys at the bottom end of the file on keyboards other than Anne and emulate the Fn Caps behavior
Menu, Tray, Icon, %A_WorkingDir%\anne.ico,, 1
<+J::Send, +{Left}
<+K::Send, +{Down}
<+L::Send, +{Right}
<+I::Send, +{Up}
<+#J::Send, +#{Left}
@airstrike
airstrike / Apple Keyboard Autohotkey Script
Created March 19, 2018 15:30 — forked from mattheath/Apple Keyboard Autohotkey Script
A script for autohotkey to remap keys when using an Apple Keyboard with a Windows PC
;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: Matt Heath <[email protected]>
;
; Script Function:
; Remaps keys when using an Apple Keyboard with a Windows PC
;
@airstrike
airstrike / stringifs.bas
Last active September 23, 2020 05:03
JoinIf, GetIf, Split functions for Excel
Option Explicit
Public Function GetIf(ByRef Rng As Range, ByVal If1 As Variant, ByVal If2 As Variant, Optional ByVal Indx As Variant) As Variant
Dim i As Long, cell_count As Long
cell_count = Rng.Cells.Count
Dim Results As New Collection
For i = 1 To cell_count
If GetObject(If1, i) = GetObject(If2, i) Then Results.Add Rng.Cells(i)
Next
price lot
1.689468884 3178.137652
1.730093363 3443.478261
1.686871655 2454.545455
1.757363529 4773.722628
1.763768192 2619.946092
1.824463184 3165
1.799693705 2774.86911
1.77497838 2160.493827
1.751901238 3622.340426
'from http://peltiertech.com/Excel/Charts/LabelLastPoint.html
Sub LastPointLabel()
Dim mySrs As Series
Dim iPts As Long
Dim bLabeled As Boolean
If ActiveChart Is Nothing Then
MsgBox "Select a chart and try again.", vbExclamation, "No Chart Selected"
Else
For Each mySrs In ActiveChart.SeriesCollection
bLabeled = False
@airstrike
airstrike / RemoveUnusedNumberFormats.bas
Created October 24, 2016 01:44
Remove Unused Number Formats in Excel (VBA)
Sub RemoveUnusedNumberFormats()
Dim strOldFormat As String
Dim strNewFormat As String
Dim aCell As Range
Dim sht As Worksheet
Dim strFormats() As String
Dim fFormatsUsed() As Boolean
Dim i As Integer
If ActiveWorkbook.Worksheets.Count = 0 Then
@airstrike
airstrike / DropUnusedStyles.bas
Created September 1, 2016 22:55
VBA: Remove unused cell styles from Excel
' Latest version available at:
' http://stackoverflow.com/questions/2449755/too-many-different-cell-formats/8933399#8933399
' Description:
' Borrowed largely from http://www.jkp-ads.com/Articles/styles06.asp
Option Explicit
' Description:
' This is the "driver" for the entire module.
Public Sub DropUnusedStyles()
~+x::
if WinActive("ahk_class AcrobatSDIWindow") {
SetKeyDelay, 15
Send, ^+{F10}
Send, {h}
Send, {ESC}
return
} else {
return
}