Skip to content

Instantly share code, notes, and snippets.

View zkarpinski's full-sized avatar
🏠
Working from home

Zachary Karpinski zkarpinski

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am zkarp on github.
  • I am zkarpinski (https://keybase.io/zkarpinski) on keybase.
  • I have a public key ASCIZeQaG3UYqQUP7LVAqe5l9ocN-x76t2JGofk0q9Tf4go

To claim this, I am signing this object:

@zkarpinski
zkarpinski / Regex.vb
Created June 22, 2014 06:35
How can I clean this up?
Public Sub Regex()
Dim strRegex As String
strRegex = GlobalModule.RegexAccount(mSubject)
If strRegex = "ACC# NOT FOUND" Then
strRegex = GlobalModule.RegexCustomer(mSubject)
If strRegex = "CUST# NOT FOUND" Then
strRegex = GlobalModule.RegexAccount(mBody)
If strRegex = "ACC# NOT FOUND" Then
strRegex = GlobalModule.RegexCustomer(mSubject)
If strRegex = "CUST# NOT FOUND" Then
@zkarpinski
zkarpinski / Vim Commands
Last active September 13, 2019 12:15
130+ essential vim commands
130+ essential vim commands
Published on August 12th, 2013 by Jean. 22 Comments -
Since the 70′s, vi and vim are very popular text editors among programmers. 5 years ago, I wrote an article named “100 vim commands every programmer should know” and here is a reworked, updated version. Enjoy!
Basics
:e filename Open filename for edition
:w Save file
:q Exit Vim
:q! Quit without saving
@zkarpinski
zkarpinski / Rename_PC.bat
Created March 24, 2014 07:22
Rename a Windows XP PC
REM:::SETS TEXT & BACKGROUND COLORS
CLS
@echo off
ECHO.
ECHO The following is meant to change the computer name after imaging on boot.
ECHO If this is incorrect please close the window.
ECHO.
ECHO.
ECHO The file will delete itself after a successful rename
ECHO.
@zkarpinski
zkarpinski / Excel_Formulas.md
Last active August 29, 2015 13:57
Excel Formulas and Specific VBA Scripts

Excel Formulas that are useful

Query with outside variable

This forumla runs a query where the contains data, is using outside sources from a specific cell concatenated with a string.

=Query(Markets!2:151,"select B where A contains'" & Concatenate (Portfolio!B4, "/BTC") &"' ")
@zkarpinski
zkarpinski / GetBTCPrice.js
Created March 24, 2014 06:31
Parses and returns current Bitcoin price in the desired currency.
//GetBTCPrice
//Parses BTC price from a selected exchange.
function GetBTCPrice(currency){
//TODO: Change to a better exchange like Mt. Gox. ^_^
if (currency === null){currency = "usd";}
var url = "https://btc-e.com/api/2/btc_" + currency.toLowerCase() + "/ticker";
var response = UrlFetchApp.fetch(url).getResponseCode();
if (response == 200)
{
var btcdata = UrlFetchApp.fetch(url).getContentText();
@zkarpinski
zkarpinski / GetCryptCoin.js
Created March 24, 2014 06:17
Returns the last trade price for a desired crypto-currency coin.
//*NOTE* 500 Server Internal Server Error status very common when used with multiple coins
//Returns the price of the desired coin in BTC or LTC
function GetCryptCoin(coin,base){
const url = "http://pubapi.cryptsy.com/api.php?method=marketdatav2";
if (base === null){base = "BTC"}
var response = UrlFetchApp.fetch(url).getResponseCode();
if (response == 200) {
var cryptsydata = UrlFetchApp.fetch(url).getContentText();
var object = JSON.parse(cryptsydata);
@zkarpinski
zkarpinski / Google_it.vb
Last active March 31, 2018 16:17
VBA Script to Google a seleciton of cells within excel
'Microsoft Excel Macros Master Module
'Community collaboration of macros for Microsoft Excel 2010 and 2013.
Attribute VB_Name = "Master_Module"
Public Sub GoogleIt()
'Google searches each item in selection
Attribute GoogleIt.VB_Description = "Google searches each item in selection"
Dim itemList, item As Variant
Dim ie As Object