Skip to content

Instantly share code, notes, and snippets.

View benkoshy's full-sized avatar

Ben Koshy benkoshy

View GitHub Profile
@benkoshy
benkoshy / google_form_submission_notification.js
Last active July 4, 2025 03:33
Google Scripts API - OnSubmit
function onSubmit(e) {
// some work is done here:
// var form = FormApp.getActiveForm();
// var allResponses = form.getResponses();
// var latestResponse = allResponses[allResponses.length - 1];
// var response = latestResponse.getItemResponses();
// var payload = {};
// for (var i = 0; i < response.length; i++) {
// var question = response[i].getItem().getTitle();
@benkoshy
benkoshy / then_example.rb
Created July 1, 2025 09:16
An example of then
# https://benkoshy.github.io/2024/12/09/then-ruby-keyword.html
# this is a contrived example
# experiment with it in an IRB console.
# we want to:
# take a string
# add convert it to an int
# add 1 to that
# and then cube it
@benkoshy
benkoshy / outline_ideas.md
Last active January 23, 2025 22:18
Pagy - Ideas on Outline of the Docs

Things which could be improved:

  • Move away from API docs and Extras "docs" as separate pages ----> makes things harder to find and needlessly complicated.
  • Improve "discoverability" problem. i.e. for example - to help readers answer the question: "which extras do I need, and why?" I feel I can improve upon this currently.

The rest:

  • The rest of the docs seem pretty good. We have config options for advanced use cases.

Questions:

@benkoshy
benkoshy / go-fibonacci.md
Created December 31, 2024 00:05
Go - Tour exercise - Fibonacci
@benkoshy
benkoshy / omakub-1-install.sh
Last active November 22, 2024 23:17
install calls boot
eval "$(wget -qO- https://gist.githubusercontent.com/benkoshy/f55d669ab8f8abcb9d131a940a782e1f/raw/1437cbd269547773c0bf5be4356b83d14a078fbb/omakub-2-boot.sh)"
@benkoshy
benkoshy / omakub-2-boot.sh
Last active November 22, 2024 22:34
echo hello world
echo "hello world"
@benkoshy
benkoshy / pagy-fix-group-date.md
Last active July 29, 2024 04:25
Pagy - fix group date

Updated

(2024-07-29 11:25 am GMT 7 Vietnam time):

bundle list

Gems included by the bundle:
  * actioncable (7.1.3.4)
  * actionmailbox (7.1.3.4)
@benkoshy
benkoshy / tekla-api-get-objects-currently-selected.md
Last active August 1, 2024 01:52
Tekla API: How to get objects that are currently selected.




In previous posts I have told you how to:

  • programatically select objects in Tekla. i.e. you have a set of parts in memory, and you want them selected.
@benkoshy
benkoshy / tekla-api-highlight-object.md
Created July 22, 2024 02:07
Tekla API - How to highlight model objects

We want to:

  • select an object,
  • and we need the user to understand that it has been selected.

This is done through: (i) highlighting it, and (ii) via a display prompt.

Don Norman elaborates on the need to alert users

@benkoshy
benkoshy / tekla-api-test-by-coordinate-systems-method.md
Last active July 11, 2024 08:05
Demonstrates how the ByCoordinateSystems method works using the Tekla Open API

Please review the MatrixFactory.ByCoordinateSystems Method in order to get the most out of this post. Particularly:

Returns a coordinate transformation matrix defined by two coordinate systems. With the returned matrix points can be transformed from the first coordinate system to the second coordinate system. The ByCoordinateSystems method is meant for transforming points between coordinate systems asked in the same work plane.

            //