Skip to content

Instantly share code, notes, and snippets.

View sebastian-marinescu's full-sized avatar
🤓

Sebastian G. Marinescu sebastian-marinescu

🤓
View GitHub Profile
@bwente
bwente / SummaryAI.php
Created March 30, 2023 12:20
SummaryAI Plugin for MODX (uses OpenAi API)
<?php
$model = $modx->getOption('model', $scriptProperties);
$prompt = $modx->getOption('prompt', $scriptProperties);
$api_url = $modx->getOption('api_url', $scriptProperties);
$api_key = $modx->getOption('api_key', $scriptProperties);
switch($modx->event->name) {
case 'OnDocFormSave':
// Check if the resource has a summary
if (!$resource->get('introtext')) {
@tkadlec
tkadlec / perf-diagnostics.css
Last active June 8, 2023 17:47
CSS used to highlight potential performance issues
:root {
--violation-color: red; /* used for clear issues */
--warning-color: orange; /* used for potential issues we should look into */
}
/* IMAGES */
/*
* Lazy-Loaded Images Check
* ====
@theodorosploumis
theodorosploumis / Nework_throttling_profiles.md
Last active July 2, 2024 05:41
Web development - Custom network throttling profiles
Profile download (kb/s) upload (kb/s) latency (ms)
Native 0 0 0
GPRS 50 20 500
56K Dial-up 50 30 120
Mobile EDGE 240 200 840
2G Regular 250 50 300
2G Good 450 150 150
3G Slow 780 330 200
@tomhicks
tomhicks / plink-plonk.js
Last active March 18, 2024 02:23
Listen to your web pages
@sebastian-marinescu
sebastian-marinescu / JSMin.class.php
Created November 15, 2018 01:31 — forked from justindmartin/JSMin.class.php
JSMin -- Ryan Grove <ryan@wonko.com> (PHP port) -- Steve Clay <steve@mrclay.org> (modifications + cleanup) -- Andrea Giammarchi <http://www.3site.eu> (spaceBeforeRegExp) -- 2002 Douglas Crockford <douglas@crockford.com> (jsmin.c) -- 2008 Ryan Grove <ryan@wonko.com> (PHP port) -- http://opensource.org/licenses/mit-license.php MIT License -- http:…
<?php
/**
* JSMin.php - modified PHP implementation of Douglas Crockford's JSMin.
*
* <code>
* $minifiedJs = JSMin::minify($js);
* </code>
*
* This is a modified port of jsmin.c. Improvements:
*
@tanaikech
tanaikech / submit.md
Created August 20, 2018 01:03
Replacing Text to Image for Google Document using Google Apps Script

Replacing Text to Image for Google Document using Google Apps Script

This is a sample script for replacing text to image for Google Document using Google Apps Script (GAS). There is a method for replacing text to text at Class Text of DocumentApp. But there are not methods for replacing text to image. So I created this sample script.

Demo :

This sample image was created by k3-studio.

Usage :

@Indigo744
Indigo744 / LanguageMatch
Created February 19, 2018 15:27 — forked from christianseel/LanguageMatch
LanguageMatch MODX Snippet – Redirects the visitor based on it's browser language
<?php
/**
* LanguageMatch
* Based on https://gist.github.com/christianseel/504302ce8ddfcde009c0
* Original code by http://stackoverflow.com/a/3771447
*
* Udated by Indigo74 for prefix/suffix and default context
*/
define('CONTEXT_PREFIX', 'web-');
@oliveratgithub
oliveratgithub / emojis.json
Last active July 2, 2024 12:24
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "👩‍👩‍👧‍👧", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👧‍👦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👦‍👦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "&#128105;&zwj;&#128105;&zwj;&#128102;&zwj;&#128102;", "category": "People & Body (family)", "order": ""},
{"emoji": "👨‍👩‍👧‍👧", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "&#128104;&zwj;&#128105;&z
@jonleverrier
jonleverrier / cbContentEditor.php
Last active December 30, 2021 22:49
This MODX plugin hides certain Content Blocks buttons from a specific MODX user group. It also disables the drag and drop functionality, so that you can provide some users with a more locked down version of Content Blocks.
<?php
/**
* Content Blocks cbContentEditor Plugin
*
* This plugin hides certain CB buttons from certain MODX user groups
* and disables the drag and drop functionality, so that you can provide
* some clients with a more locked down version of CB.
*
* I would suggest setting up CB templates and defaults in the CB component manager,
* so that predefined layouts are loaded automatically when a new resource is created.
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 3, 2024 20:40
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example