Skip to content

Instantly share code, notes, and snippets.

// from line 38520
StickyRowFeature.prototype.checkStickyRows = function () {
var _this = this;
var height = 0;
if (!this.gridOptionsService.isGroupRowsSticky()) {
return this.refreshNodesAndContainerHeight([], height);
}
var stickyRows = [];
var firstPixel = this.rowRenderer.getFirstVisibleVerticalPixel();
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Config
# Load version control information

Sorting Grouped Rows independently of Leaf Rows

Intro

Our users have many different uses of grids, using multiple row groups and sorts. It's been a long time want of our users to sort row groups in certain ways but unfortunately have been unable to do this successfully.

A specific scenario, using ag-grid's demo olympic dataset: There is a table of athletes, grouped by date, then grouped by country. We want to sort the country groups rows by total number of gold medals descending, sort the date group rows by their own date descending and finally sort the athlete (leaf) rows by total number of medals.

Current behaviour

@davidnormo
davidnormo / .gitconfig
Last active February 8, 2023 13:02
.gitconfig
[user]
name = Dave Normington
email = <work.email@address.com> # <--- change this
[alias]
wipe = reset --hard head
l = log --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=short
out-bw = log --pretty=format:'%h %ad %an%d %s' --date=short --no-color
last = log -1 HEAD
ch = checkout
@davidnormo
davidnormo / index.js
Last active April 14, 2020 14:43
Jumping steps problem (javascript)
/*
A flight of stairs has `n` steps, you are able to jump 1, 2, or 3 steps at a time.
How many different ways are you able to climb the stairs in different combinations of jumps?
E.g. n = 3 then the answer is 4 because: 111, 21, 12, 3
*/
const replaceIndexWithNum = (str, i, num) => {
return str.substring(0, i)+num+str.substring(i+num)
}
@davidnormo
davidnormo / configToOpts
Created June 24, 2017 01:27
json config file to cmd opts string
#!/usr/local/bin/node
const fs = require('fs');
const configPath = process.argv[2];
fs.readFile(configPath, (err, data) => {
if (err) {
console.error(err);
process.exit(1);
@davidnormo
davidnormo / .tmux.conf
Last active February 8, 2023 12:57
My tmux config
# remap prefix from C-b to ` (backtick)
unbind C-b
set-option -g prefix `
bind-key ` send-prefix
unbind ^A
# Start window numbering at 1
set -g base-index 1
@davidnormo
davidnormo / removingJsCode.md
Last active May 11, 2016 14:46
Removing Javascript Code

Tips for removing javascript code

  1. Removing files should be relatively safe. If you miss any references your build system should fail, hopefully with the problem files if the tool is any good.

  2. Removing scoped code can be done if all references to them are removed from within the scope. E.g. references to a local variable within a method or references to a function within a module.

  3. Removing public functions, that are exported by a module or added to the global scope, cannot be done deterministically due to the dynamic nature of javascript. Try the following:

    • grep code base looking for method uses (Warning: may not catch all cases e.g. myObj['method']() or myObj[getMethodName()]() etc)

    • grep code looking for the import of the containing module, then further grep to find method references: grep -ril path/to/my/module www/src | xargs grep -ril myMethodName

@davidnormo
davidnormo / npm-global-export-import.md
Last active March 31, 2016 11:19
npm global export import

The following command will give you a string of all the npm packages and their versions that are currenctly globally installed.
Note: that this ignores packages installed from directories and picks only those installed via the npm registry.

$ npm ls -g --depth 0 | sed -e '1d' -e 's/└── //g' -e 's/├── //g' -e '/^.*->.*$/d' -e '/^$/d' | tr '\n' ' '

If you copy this string, you can then append it to the end of npm install -g to install all of the packages.

@davidnormo
davidnormo / toDeepEqual.js
Last active September 1, 2017 11:18
Deep equality jasmine 2.3 matcher
"use strict";
var observableDiff = require("deep-diff").observableDiff,
lodash = require("lodash");
function valueToString(target) {
return JSON.stringify(target, function(key, value) {
var type = Object.prototype.toString.call(value);
if (value instanceof jasmine.Any) {