This file contains hidden or 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
| public static IEnumerable<Type> GetLoadableTypes(this Assembly assembly) | |
| { | |
| if (assembly == null) throw new ArgumentNullException("assembly"); | |
| try | |
| { | |
| return assembly.GetTypes(); | |
| } | |
| catch (ReflectionTypeLoadException e) | |
| { | |
| return e.Types.Where(t => t != null); |
This file contains hidden or 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
| function setValidatorStatus(status) { | |
| var validator = document.getElementById('<%=rfvYourValidatorControl.ClientID %>'); | |
| //prevent validation while enable the validator | |
| if (status === true && ( validator.enabled || validator.enabled == null)) { | |
| return; | |
| } | |
| ValidatorEnable(validator, status); | |
| } |
This file contains hidden or 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
| Id currentUserId = UserInfo.getUserId(); | |
| List<User> delegatedToUsers = [select Id, | |
| Name, | |
| DelegatedApproverId | |
| from User | |
| where DelegatedApproverId=:currentUserId]; | |
| system.debug(delegatedToUsers); |
This file contains hidden or 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
| Id userId = 'ID_TO_REPLACE';//be careful! | |
| Opportunity[] oppos = [select Id, | |
| Name | |
| from Opportunity | |
| where CreatedById = :userId]; | |
| system.debug(oppos.size()); | |
| delete oppos; |
This file contains hidden or 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
| Id userId = 'ID_TO_REPLACE';//be careful! | |
| CAP_ContractApprovalRequest__c[] caps = [select Id, | |
| Name | |
| from CAP_ContractApprovalRequest__c | |
| where CreatedById = :userId]; | |
| system.debug(caps.size()); | |
| delete caps; |
This file contains hidden or 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
| Approval.ProcessWorkitemRequest pwr = new Approval.ProcessWorkitemRequest(); | |
| pwr.setWorkitemId('04iS00000002qOKIAY'); | |
| pwr.setAction('Removed'); | |
| Approval.ProcessResult result2 = Approval.process(pwr); | |
| system.debug(result2); |
This file contains hidden or 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
| _honsf.appendJS = function(fileName, onloadHandler) { | |
| var fileref = document.createElement("script"); | |
| fileref.setAttribute("type", "text/javascript"); | |
| fileref.setAttribute("src", fileName); | |
| if(fileref.readyState){ | |
| fileref.onreadystatechange = function () { | |
| /*console.log("state change" + this.readyState);*/ | |
| if (this.readyState == 'complete' || this.readyState == "loaded") { | |
| /*console.log("state = complete");*/ |
This file contains hidden or 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
| protected static void CleanTables() | |
| { | |
| List<string> listOfTableNames = new List<string> { "UserRole", "Role", "Address", "User" }; | |
| EFContext context = new EFContext(); | |
| foreach (var tableName in listOfTableNames) | |
| { | |
| context.ExecuteStoreCommand("DELETE [" + tableName + "]"); | |
| } | |
| } |
This file contains hidden or 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
| (function ($) | |
| { | |
| $.fn.iframePostForm = function (options) | |
| { | |
| var response, | |
| returnReponse, | |
| element, | |
| status = true, | |
| iframe; | |
This file contains hidden or 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
| // ==UserScript== | |
| // @name Google SSL Privacy Real Link | |
| // @namespace http://userscripts.org/scripts/show/145014 | |
| // @description Mandatory use encryption connection https. Gets rid of almost every google tracking device. Disable the Google search rewrite, always showing and using the real, original, direct link URLs, also to prevent from using redirected pages that might be temporarily unavailable in some area. | |
| // @include http://images.google.*/images* | |
| // @include http://www.google.*/images* | |
| // @include http://www.google.*/webhp* | |
| // @include http://www.google.*/search?* | |
| // @include http://www.google.*/imgres* | |
| // @include http://images.google.*/search?* |