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
<?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
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". |
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 | |
require_once('include/MVC/View/views/view.list.php'); | |
class CustomAccountsViewList extends ViewList | |
{ | |
/** | |
* @see ViewList::preDisplay() | |
*/ | |
public function preDisplay() |
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 | |
class CustomAccountsController extends SugarController | |
{ | |
public function action_displaypassedids() { | |
if ( !empty($_REQUEST['uid']) ) { | |
$recordIds = explode(',',$_REQUEST['uid']); | |
foreach ( $recordIds as $recordId ) { | |
$bean = SugarModule::get($_REQUEST['module'])->loadBean(); | |
$bean->retrieve($recordId); |
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
#!/bin/bash | |
# based on the script by Bojan Popic https://gist.github.com/bojanpopic/2c3025d2952844de1dd0 | |
# Gets all issues form a repo. Since Pull Requests are also Issues in Github internally, these are also included. | |
repo="organization/repoName" # put the name of the repo here. Usually it is like this: organization/repo-na$ | |
username="myuser" # your github username | |
password="mypassword" # your github password | |
# this script can be used on public repos with any user's credentials, you don't have to own the repo! |