Skip to content

Instantly share code, notes, and snippets.

View Quixomatic's full-sized avatar
Developing SalesWon

James Freund Quixomatic

Developing SalesWon
View GitHub Profile
javascript:(function() {
try {
const a = document.createElement('a');
const dom = document.querySelector('main > .flex-1 > .h-full .flex');
const template = document.createElement('template');
const title = document.title;
template.innerHTML = dom.innerHTML;
['.items-end', 'img', 'svg', 'button', ':empty'].forEach(selector => {
template.content.querySelectorAll(selector).forEach(node => {
node.remove();
@Quixomatic
Quixomatic / babel-plugin-jsx-now-pragmatic.js
Created January 13, 2023 22:49
Replacement file to make `@quixomatic/ui-renderer-react` work properly
/**
* @license
* Copyright (c) 2020 ServiceNow, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@Quixomatic
Quixomatic / Dynamic Import ES6.js
Last active October 9, 2020 12:42
JAVASCRIPT: Dynamically import something in es6
const getAsyncImport = async () => {
try {
const dynamicThing = 'faCoffee';
const something = await import(`/${dynamicThing}`);
console.log(something);
} catch (error) {
alert('it did not import properly!');
}
};
@Quixomatic
Quixomatic / Sort Array by Property Alphabetically.js
Last active October 5, 2020 14:44
JAVASCRIPT: Sort Array By Property Alphabetically
objArray.sort(function(a, b) {
var textA = a.DepartmentName.toUpperCase();
var textB = b.DepartmentName.toUpperCase();
return (textA < textB) ? -1 : (textA > textB) ? 1 : 0;
});
buildJson(function (data) {
// Calculate total nodes, max label length
var totalNodes = 0;
var maxLabelLength = 0;
// variables for drag/drop
var selectedNode = null;
var draggingNode = null;
// panning variables
var panSpeed = 200;
[
[{
"label": "Data Analytics/ Databases",
"id": -32,
"department": "IT",
"parent": null
}, {
"label": "Data Infrastructure",
"id": -43,
"department": "IT",
{
"name": "flare",
"children": [{
"name": "analytics",
"children": [{
"name": "cluster",
"children": [{
"name": "AgglomerativeCluster",
"size": 3938
}, {
var function_array = {
// sets the dates for creation of a new document
"setDateTimes" : function (req, res, next) {
var tempDate = new Date().toISOString();
req.body.created_date = tempDate;
req.body.updated_date = tempDate;
next();
},
// sets the created by and updated by for creation of a new document
var convertOptions = function (obj) {
var temp = [];
var tempFunctionArray = [];
// Pre Create
if (obj.preCreate !== undefined) {
temp = obj.preCreate.split(',');
tempFunctionArray = [];
for (var i = 0; i < temp.length; i++) {
tempFunctionArray.push(function_array[temp[i]]);

Floating Title Experiment

A title that gives the appearance of floating in the ocean

Original code base from Manuel Ro's codepen

A Pen by James Freund on CodePen.

License.