Skip to content

Instantly share code, notes, and snippets.

View pgorod's full-sized avatar


View GitHub Profile
pgorod / Add_WindowsDefender_Exclusions.ps1
Created November 18, 2023 10:52 — forked from dkorobtsov/Add_WindowsDefender_Exclusions.ps1
PowerShell script to add Windows Defender exclusions for WSL2 and JetBrains IDE performance issues
# PowerShell script to add Windows Defender exclusions for WSL2 and JetBrains IDE performance issues
# For context please read this thread:
# How to use?
# - Save the Script: Open a text editor like Notepad and paste the PowerShell script into it.
# - Save the file with a .ps1 extension, for example, Add_WindowsDefender_Exclusions.ps1.
# - Run PowerShell as Administrator: Search for "PowerShell" in the Start menu, right-click on it, and choose "Run as administrator".
# - Navigate to the Script's Location: Use the cd command to navigate to the directory where you saved the .ps1 file.
pgorod / gist:afcc4adc321a8dd0e43c5a9f5dac0c17
Created July 3, 2023 15:36
RME Screenshots for forum question
See images in comments below.
pgorod / kunena3.rb
Created January 31, 2023 11:39
require "mysql2"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
# If you change this script's functionality, please consider making a note here:
# Before running this script, paste these lines into your shell,
# then use arrow keys to edit the values
pgorod / base.rb
Created January 31, 2023 11:35
# frozen_string_literal: true
if ARGV.include?('bbcode-to-md')
# Replace (most) bbcode with markdown before creating posts.
# This will dramatically clean up the final posts in Discourse.
# In a temp dir:
# git clone
# cd ruby-bbcode-to-md
pgorod / gist:bd53339fbf6bddbed824c762539ed058
Last active March 12, 2020 14:20 — forked from jmertic/gist:5660495
Programmatically Find the Name of the Relationship between two Modules
function getRelationshipByModules ($m1, $m2)
global $db,$dictionary,$beanList;
$rel = new Relationship;
if($rel_info = $rel->retrieve_by_sides($m1, $m2, $db)){
$bean = BeanFactory::getBean($m1);
$rel_name = $rel_info['relationship_name'];
foreach($bean->field_defs as $field=>$def){
pgorod / showAsPrint.js
Created June 25, 2019 09:51 — forked from jscher2000/showAsPrint.js
Emulate print media in Firefox 62 (userscript work in progress)
// For Firefox's Web Console, creates the functions showAsPrint() and undoShowAsPrint()
// to roughly emulate print media and revert
function showAsPrint(){
var docSS = document.styleSheets, ss, oldMedia, newMedia, rules;
var p2s = function(media){
if (media.indexOf('all') > -1) return media; //no need to change
if (media == 'print') return 'all, wasprint'; //show on screen, too
if (media.indexOf('print') > -1 && media.indexOf('screen') > -1) return media; //no need to change
if (media == 'screen') return 'wasscreen'; //hide these rules
if (media.indexOf('screen') > -1) return media.replace('screen', 'wasscreen'); //hide these rules
namespace Pokus;
class Exception extends \Exception
function tttt($string)
try {
pgorod / repair.php
Created December 12, 2018 18:04 — forked from chicks/repair.php
Quick Repair and Rebuild Sugar from the Command line - adapted from Jeff Bickhart's version.
#! /usr/bin/env php
# Stuff we have to do
if(!defined('sugarEntry'))define('sugarEntry', true);
function usage() {
global $argv;
return "\n" . $argv[0] . " <path to sugar>\n";
pgorod / Import_script.php
Last active July 22, 2022 08:33
Sample Import_script for SuiteCRM, CSV to beans and relationships, and security groups
if (!defined('sugarEntry') || !sugarEntry) die ('Not a Valid Entry Point!');
$date= new DateTime();
echo 'School Importer started at ';
echo $date->format('r').'<br>';
echo '-------------------------------------------------------------------------------------------------------------------------------------<br>';
pgorod / Undo a commit and redo
Created April 2, 2018 17:00 — forked from tkersey/Undo a commit and redo
Git: undo a commit and redo
Undo a commit and redo
$ git commit ...
$ git reset --soft HEAD^ (1)
$ edit (2)
$ git commit -a -c ORIG_HEAD (3)
This is most often done when you remembered what you just committed is incomplete, or you misspelled your commit message, or both. Leaves working tree as it was before "reset".