Skip to content

Instantly share code, notes, and snippets.

@lexeek
lexeek / ReadWriteExcelFile.java
Created April 27, 2024 00:09 — forked from madan712/ReadWriteExcelFile.java
Read / Write Excel file (.xls or .xlsx) using Apache POI
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import {ServerErrorResponseParser} from '../../../../src/components/common/Helpers/ServerErrorParser/server.error.response.parser';
describe('ServerErrorParser', () => {
test('hasError', () => {
const testCases = [{
name: 'Empty response object',
response: {},
actual: false
}, {
name: 'Undefined',
@lexeek
lexeek / input.scss
Created July 1, 2022 14:18
Generated by SassMeister.com.
@use "sass:color";
$white: #FFFFFF;
$bg-01: #202123;
$bg-02: #252628;
$bg-03: #2B2C2E;
$bg-04: #2F3032;
$bg-05: $white;
$bg-06: $white;
@lexeek
lexeek / input.scss
Created July 1, 2022 14:16
Generated by SassMeister.com.
@use "sass:color";
$white: #FFFFFF;
$bg-01: #202123;
$bg-02: #252628;
$bg-03: #2B2C2E;
$bg-04: #2F3032;
$bg-05: $white;
$bg-06: $white;
@lexeek
lexeek / index.html
Created June 1, 2022 22:22 — forked from archetana/index.html
Pan and Zoom in jsPlumb Community Edition with Dagre and jQueryUI Draggable
<div class="container">
<div class="panzoom">
<div class="diagram">
<div id="i0" class="item">Root!</div>
<div id="i1" class="item">Child 1</div>
<div id="i11" class="item">Child 1.1</div>
<div id="i12" class="item">Child 1.2</div>
<div id="i2" class="item">Child 2</div>
<div id="i21" class="item">Child 2.1</div>
<div id="i3" class="item">Child 3</div>
import {BaseEventEmitter} from './base.event.emitter'
import {RESIZE_EVENT_NAME, ResizeEventEmitter} from "./resize.event.emitter";
import {fromEvent, Subscription} from "rxjs";
export const CHANGE_OFFSET_SIZE = 'change:offset:size';
export interface ChangeOffsetSizeData {
element: HTMLElement;
newOffsetWidth: number;
{
"masterId": "xnEAAARaZhn7WA",
"revisionId": "CIKAAABbZhn7WA",
"revision": "B",
"statuses": [
{
"name": "TCM Released",
"displayName": "TCM Released"
}
],
@lexeek
lexeek / caret.js
Created January 21, 2021 10:05 — forked from nothingismagick/caret.js
Small script to detect caret pixel position in contenteditable div
/**
* Get the caret position in all cases
*
* @returns {object} left, top distance in pixels
*/
getCaretTopPoint () {
const sel = document.getSelection()
const r = sel.getRangeAt(0)
let rect
let r2
@lexeek
lexeek / _spacing-helpers.scss
Created September 22, 2020 21:44 — forked from jacurtis/_spacing-helpers.scss
SASS Margin and Padding Helpers Loop. Generates .m-t-10 type helper classes.
/*
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects.
It will generate several classes such as:
.m-r-10 which gives margin-right 10 pixels.
.m-r-15 gives MARGIN to the RIGHT 15 pixels.
.m-t-15 gives MARGIN to the TOP 15 pixels and so on.
.p-b-5 gives PADDING to the BOTTOM of 5 pixels
.p-l-40 gives PADDING to the LEFT of 40 pixels
@lexeek
lexeek / dom.service.ts
Created June 23, 2020 18:02 — forked from caroso1222/dom.service.ts
Service to dynamically append Angular components to the body
import {
Injectable,
Injector,
ComponentFactoryResolver,
EmbeddedViewRef,
ApplicationRef
} from '@angular/core';
@Injectable()
export class DomService {