Skip to content

Instantly share code, notes, and snippets.

View dzhibas's full-sized avatar
🌍
Planet Earth

Nikolajus Krauklis dzhibas

🌍
Planet Earth
View GitHub Profile
@karlingen
karlingen / switch_user.php
Last active April 23, 2021 15:17
SugarCRM user switching / login as another user
<?php
/**
* Login as another user in SugarCRM and switch back to admin user
*
* Simply put this file into a custom entry point file and
* browse to it with the parameters 'user_name' or 'back_to_sudo'
*
* Usage:
* http://xxxxxxxxx/index.php?entryPoint=my_awesome_entry_point&user_name=mylittlepony
* http://xxxxxxxxx/index.php?entryPoint=my_awesome_entry_point&back_to_sudo=1
@maranemil
maranemil / gist:4ad5cb3b5b9d7a41bfd4
Last active August 8, 2018 05:00
SugarCRM 7.5 performance optimization tuning
<?php
/***CONFIGURATOR***/
$sugar_config['save_query'] = 'populate_only';
$sugar_config['verify_client_ip'] = false;
$sugar_config['disable_count_query'] = true;
$sugar_config['disable_vcr'] = true;
$sugar_config['hide_subpanels'] = true;
$sugar_config['hide_subpanels_on_login'] = true;
$sugar_config['external_cache_disabled'] = true;
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active April 17, 2024 10:51
Backend Architectures Keywords and References
@ben
ben / Outline.md
Last active December 11, 2015 11:19
Resources from introductory class at PHP Benelux
@nijikokun
nijikokun / example-user.js
Created May 3, 2012 20:46
Beautiful Validation... Why have I never thought of this before?!
var user = {
validateCredentials: function (username, password) {
return (
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' }
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' }
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' }
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' }
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' }
: false
);
@datagrok
datagrok / gist:2199506
Last active April 8, 2023 17:36
Virtualenv's `bin/activate` is Doing It Wrong