Skip to content

Instantly share code, notes, and snippets.

Function ConCat(Delimiter As Variant, ParamArray CellRanges() As Variant) As String
Dim Cell As Range, Area As Variant
If IsMissing(Delimiter) Then Delimiter = ""
For Each Area In CellRanges
If TypeName(Area) = "Range" Then
For Each Cell In Area
If Len(Cell.Value) Then ConCat = ConCat & Delimiter & Cell.Value
Next
Else
ConCat = ConCat & Delimiter & Area
/*
* Scrapes text Q&A data out of a Quizlet deck list view
*
* usage: paste this function into developer console, then
* copy(scrape_quizlet()) to get a JSON string on
* the clipboard.
*/
function scrape_quizlet() {
var get_text = function(i,elem) { return jQuery(elem).text(); };
@abeyer
abeyer / quickjinja.py
Created September 11, 2015 19:55
splat json data on a jinja2 template from the command line
import json
import click
from jinja2 import Environment, FileSystemLoader, StrictUndefined
@click.command()
@click.argument('template_file')
@click.argument('data_file')
def main(template_file, data_file):
env = Environment(loader=FileSystemLoader(searchpath='.'), undefined=StrictUndefined)
@abeyer
abeyer / start_tmux.sh
Created October 12, 2015 02:21
chromebook devenv startup
# handle (most of) the color/encoding issues w/ using vim+solarized+tmux under crouton in the chrome shell window
export TERM=xterm-256color
export LC_ALL=en_US.utf-8
export LC_LANG=en_US.utf-8
tmux -2
import re
import icalendar
import pytz
strkeys = ['UID','SUMMARY','LOCATION','DESCRIPTION']
timekeys = ['DTSTART', 'DTEND']
otherkeys = ['STATUS']
tz = pytz.timezone("US/Pacific")

Keybase proof

I hereby claim:

  • I am abeyer on github.
  • I am abeyer (https://keybase.io/abeyer) on keybase.
  • I have a public key ASByivrkp_JvSmCuBsZg5Ie-3jAntG9nPUKqKIaFSdWAIAo

To claim this, I am signing this object:

@abeyer
abeyer / SlackMessage.class
Created February 25, 2016 22:50
Post to slack webhooks from salesforce process builder
public with sharing class SlackMessage {
public class Params {
@InvocableVariable(label='Message' required=true)
public String msg;
}
@InvocableMethod(
label='Send a message to Slack'
description='Send the Message argument as text to a Slack webhook endpoint.'
@abeyer
abeyer / PBClearMultiPicklist.apxc
Created August 24, 2016 21:22
Set or clear multiselect picklist values from process builder
public class PBClearMultiPicklist {
public class Params {
@InvocableVariable(label='Object ID' required=true)
public String sobjectId;
@InvocableVariable(label='Picklist Field API Name' required=true)
public String fieldName;
@InvocableVariable(label='Value' required=true)
public String value;
@abeyer
abeyer / form.php
Last active September 25, 2016 00:01
php $_POST and $_SESSION
<form class="form-horizontal" role="form" method="post" action="formHandler.php">
<label for="name" class="col-sm-2 control-label">Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="name" name="name" placeholder="Your Name" value="">
</div>
<div class="col-sm-10 col-sm-offset-2">
<input id="submit" name="submit" type="submit" value="submit" class="btn btn-primary">
</div>
/**
* @OnlyCurrentDoc
*/
/*
* Triggers
*/
function onOpen() {
var ss = SpreadsheetApp.getActive();