Skip to content

Instantly share code, notes, and snippets.

View benkoshy's full-sized avatar

Ben Koshy benkoshy

View GitHub Profile
   <div class="input-group"
     data-pagy="WyJjb21ibyIsIjxhIGhyZWY9XCIvZm91bmRhdGlvbj9wYWdlPV9fcGFneV9wYWdlX18mYW1wO2l0ZW1zPTIwXCIgICBzdHlsZT1cImRpc3BsYXk6IG5vbmU7XCI+PC9hPiJd">
     <a style="margin-bottom: 0"
       class="prev button primary disabled"
-      href="#">‹&nbsp;Prev</a><span class="input-group-label"><label>Page <input
-          class="input-group-field cell shrink"
-          type="number"
-          min="1"
-          max="50"
@benkoshy
benkoshy / ObjectARX_Locations.md
Created February 7, 2023 02:13
ObjectARX Location

Location of AutoCAD ObjetARX dlls:

C:\Autodesk\ObjectARX_for_AutoCAD_2022_Win_64bit_dlm\inc\AcMgd.dll
@benkoshy
benkoshy / tekla-api-dimension-bolts-5-HowToFilterOutTheBoltsYouWant.md
Created October 8, 2017 06:27
Tekla Open API - Dimensioning Groups of Bolts - How to filter out the bolts you want - Part 5
#region public methods

        /// <summary>
        /// Bolts the positions in window. In the future, we should be able to specify in a generic way, the position of any given
        /// type which is passed in. Using polymorphism, we should be able to return the type of position points necessary, depending on the type of object.
        /// </summary>
        /// <returns></returns>
        public List<Point> BoltPositionsInWindow()
        {
@benkoshy
benkoshy / whatIsAJig.md
Last active January 15, 2023 14:51
What is a jig? AutoCAD .net API (c#)

Understanding Jigs

A video demo which will help give you a holistic view of what a jig is, and its power.

The Client

Let’s start with the client class. If you don’t understand this terminology please see a short explanation below this article.

Without commentary – The structure of a jig (within the client):

@benkoshy
benkoshy / manual_testing_github_ci.md
Last active December 26, 2022 20:14
Manually testing a github action

Ensure you ahve the following in the workflow you want to test:

on:
  workflow_dispatch:
  push:

Runn it with:

@benkoshy
benkoshy / overriding.md
Created December 22, 2022 00:50
pagy issue
module QuotesHelper 

  # overrriding this
  # => wrong number of arguments (given 3, expected 2)
  def pagy_url_for(pagy, page)
    page
  end
end
@benkoshy
benkoshy / wrap_modal_in_frame.md
Created December 19, 2022 23:50
Wrap modal + items in a turbo_frame
# psuedo-code

turbo_frame_tag "items", src: items_path do
     <div id="modal">
           <div id="items to paginate>           
            <%== pagy_nav(pagy) %>     
     </div>
end
@benkoshy
benkoshy / BoltListFromSelectedModelObjects.cs
Last active December 17, 2022 16:24
How to programmatically generate a bolt list report from selected model objects
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tekla.Structures.Geometry3d;
using Tekla.Structures.Model;
namespace RopesProject
{
@benkoshy
benkoshy / tekla-api-how-to-get-bolt-information-from-a-part.md
Created April 28, 2021 23:03
Tekla Open API - Demonstrates a hello world example of how to get bolt information from a part
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tekla.Structures.Geometry3d;
using Tekla.Structures.Model;

namespace RopesProject
@benkoshy
benkoshy / ransack_pagy.md
Created December 16, 2022 00:58
example of ransack + pagination
# controller
def index
    @q = Quote.ransack(params[:q])
    @pagy, @quotes = pagy(@q.result(distinct: true))
    
  end

  def search
 index