Skip to content

Instantly share code, notes, and snippets.

View emoran's full-sized avatar
:octocat:
Developing

Edgar Moran emoran

:octocat:
Developing
View GitHub Profile
@brianmfear
brianmfear / GetExtraLimitsForYourUnitTest.apxc
Last active January 11, 2024 05:09
Need more CPU or heap for creating your test data? Make it Queueable.
// Asking for extra CPU time and heap for those really "heavy" orgs
@isTest class GetExtraLimitsForYourUnitTest implements Queueable {
@testSetup static void testSetup() {
Test.startTest(); // TIP: this avoids governor limits for your @isTest methods
System.enqueueJob(new GetExtraLimitsForYourUnitTest()); // We'll get async limits!
// P.S. Did you know that the end of a unit test method triggers async code,
// just as if you called Test.stopTest()?
}
public void execute(QueueableContext context) {
// I now have 60000ms to do my setup, instead of just 10000ms.
@brianmfear
brianmfear / wSharingTest.apxc
Created February 9, 2022 17:59
Without Sharing overridden by System.runAs?
@isTest without sharing class wSharingTest {
@isTest static void test() {
Account a = new Account(Name='Name');
User u = [SELECT FIELDS(STANDARD) FROM User WHERE Id = :UserInfo.getUserId()].deepClone(false, false, false);
u.FederationIdentifier = '12345';
u.Alias = '12345678';
u.UserName += '.brian.fear';
u.CommunityNickname = '12345678';
u.ProfileId = [SELECT Id FROM Profile WHERE Name LIKE 'Standard%' LIMIT 1].Id;
System.runAs(new User(Id=UserInfo.getUserId())) {
Visual Studio 2017
Test Professional:
VG622-NKFP4-GTWPH-XB2JJ-JFHVF
Professional:
KBJFW-NXHK6-W4WJM-CRMQB-G3CDH
4F3PR-NFKDB-8HFP7-9WXGY-K77T7
Enterprise:
NJVYC-BMHX2-G77MM-4XJMR-6Q8QF
@santoshachari
santoshachari / Laravel PHP7 LEMP AWS.md
Last active February 20, 2024 10:00
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@ngocdaothanh
ngocdaothanh / gist:3764694
Created September 22, 2012 00:43
Scala Assignment: Recursion
package recfun
import scala.collection.mutable.ListBuffer
import common._
/** https://class.coursera.org/progfun-2012-001/assignment/view?assignment_id=4 */
object Main {
def main(args: Array[String]) {
println("Pascal's Triangle")
for (row <- 0 to 10) {