Skip to content

Instantly share code, notes, and snippets.

@sancarn
sancarn / VbaJsBridge.yaml
Created December 8, 2018 16:36
Shared with Script Lab
name: VbaJsBridge
description: ''
author: sancarn
host: EXCEL
api_set: {}
script:
content: |-
//Initialise VbaJsBridge
VbaJsBridge_Initiate();
var Timer: Number = 1000;
Public HeaderColor as Long
Private OptionsSheet as Worksheet
Private DataSheet as Worksheet
Private Sub Worksheet_Change(ByVal Target As Range)
Me.HeaderColor = RGB(217, 217, 217)
set OptionsSheet = sheets("Options")
set DataSheet = ActiveWorksheet
if target.address = "$B$1" then
@sancarn
sancarn / .Object.query.md
Last active October 16, 2018 23:51
Query javascript objects for a specific structure

Object::query()

Say you have some object:

var data = [
  {
    type:"Person",
    name: "Suzanne",
    pets:[
@sancarn
sancarn / Idea.md
Last active September 16, 2018 03:46
Ruby hash/type parser for javascript

Simplify _getList and _getKeyValues

function measureDepth(depth,index,sectionString){
  switch(sectionString[index]){
      case "{":
        depth["{}"]++;
        break;
      case "}":
 depth["{}"]--;
<!DOCTYPE html>
<html>
<head>
<script src="/libraries/jQuery.js"></script>
<script src="/libraries/Ace/build/ace.js"></script>
<script src="console.js"></script>
<link rel="stylesheet" href="console.css" type="text/css" />
<style>
html, body{
@sancarn
sancarn / Pile.rb
Last active August 30, 2018 15:27
Piles are a great way of updating all values of a set at once, instead of mapping arrays constantly.
=begin
Piles are a great way of updating all values of a set at once, instead of mapping arrays constantly.
E.G.
Example CSV:
a,b,c
1,2,3
4,5,6
Then:
csv=CSV.new(text, {:headers=>true})
# InfoWorks ICM - How to customise your toolbars
# InfoWorks ICM - How to customise your toolbars programatically
By now you should know that if I'm talking about it, it'd be because I've found a way to autoamte it!
@sancarn
sancarn / Ruby enum windows.md
Last active July 15, 2018 20:14
How to call enum windows (and other win32 functions) using dl / fiddle, in a clean manor.

Ruby IDispatch

A way of dispatching Ruby classes and objects as COM OLE objects, via win32ole.

Uses

Useful for IE intergration:

require 'win32ole'

ICM Method Lists

Attempts to produce a list of all available classes and methods available in the current ICM instance.

Issues

Currently does not retrieve methods of Object class and it's ancestors (e.g. BasicObject) - Perhaps this should be added