This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PowerShell script to add Windows Defender exclusions for WSL2 and JetBrains IDE performance issues | |
# | |
# For context please read this thread: | |
# https://github.com/microsoft/WSL/issues/8995 | |
# | |
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See images in comments below. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "mysql2" | |
require File.expand_path(File.dirname(__FILE__) + "/base.rb") | |
# If you change this script's functionality, please consider making a note here: | |
# https://meta.discourse.org/t/importing-from-kunena-3/ | |
# Before running this script, paste these lines into your shell, | |
# then use arrow keys to edit the values | |
=begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 https://github.com/nlalonde/ruby-bbcode-to-md.git | |
# cd ruby-bbcode-to-md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
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){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Pokus; | |
class Exception extends \Exception | |
{ | |
} | |
function tttt($string) | |
{ | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env php | |
<?php | |
# Stuff we have to do | |
if(!defined('sugarEntry'))define('sugarEntry', true); | |
function usage() { | |
global $argv; | |
return "\n" . $argv[0] . " <path to sugar>\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//xdebug_break(); | |
if (!defined('sugarEntry') || !sugarEntry) die ('Not a Valid Entry Point!'); | |
$date= new DateTime(); | |
//chdir('/opt/bitnami/apps/suitecrm/htdocs/'); | |
echo 'School Importer started at '; | |
echo $date->format('r').'<br>'; | |
echo '-------------------------------------------------------------------------------------------------------------------------------------<br>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://stackoverflow.com/questions/927358/git-undo-last-commit | |
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". |
NewerOlder