Skip to content

Instantly share code, notes, and snippets.

@sauloefo
sauloefo / README.md
Last active November 27, 2023 07:48
Setup Ruby on Rails development environment with asdf

TL;DR:

Copy and paste the instruction below in your BASH terminal.

It should work for any Ubuntu based distribution.

Your local user password will be required.

@sauloefo
sauloefo / solaar-on-ubuntu.md
Last active August 17, 2023 14:07
Solaar setup on Ubuntu

Install solaar

sudo add-apt-repository ppa:solaar-unifying/stable
sudo apt update
sudo apt install solaar

Add solaar to Startup applications

@sauloefo
sauloefo / create-self-signed-certificate.sh
Last active April 16, 2023 13:18
Create a Self-Signed Certificate For Salesforce Connected Apps
#!/bin/bash
# source: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_key_and_cert.htm
openssl genpkey -des3 -algorithm RSA -pass pass:SomePassword -out server.pass.key -pkeyopt rsa_keygen_bits:2048
openssl rsa -passin pass:SomePassword -in server.pass.key -out server.key
openssl req -new -key server.key -out server.csr
@sauloefo
sauloefo / .eslintrc
Created March 2, 2023 09:12
eslintrc for my salesforce projects
{
"parser": "@babel/eslint-parser",
"parserOptions": {
"requireConfigFile": false,
"babelOptions": {
"parserOpts": {
"plugins": ["classProperties", ["decorators", { "decoratorsBeforeExport": false }]]
}
}
},
List<Case> cases = new List<Case>{
new Case(Subject = 'Mild problem', Origin = 'Phone', Escalated__c = false, Status = 'Closed')
, new Case(Subject = 'Problem 1', Origin = 'Web', Escalated__c = true, Status = 'Closed')
, new Case(Subject = 'Problem 2', Origin = 'Web', Escalated__c = true, Status = 'In Progress')
, new Case(Subject = 'Problem 3', Origin = 'Email', Escalated__c = true, Status = 'Open')
};
class MildCase extends CaseEntity {
protected override Edl.Expression identityExpression() {
return subject().isEqualTo('Mild problem');
public class ExpensesSelector {
public static Map<Id, Expense> selectAll() {
return dataService.selectAll();
}
private static ExpensesDataService dataService {
get {
if (null == dataService) {
// use with sharing by default
@sauloefo
sauloefo / aliases.ps1
Last active February 15, 2023 09:15
Powershell aliases for git and sfdx commands
# git
Set-Alias -Name g -Value git -Option ReadOnly
Function Git-Status { git status $args }
Set-Alias -Name gs -Value Git-Status -Option ReadOnly
Function Git-Commit {
git add .
git commit -m $args
}
@sauloefo
sauloefo / aliases.sh
Last active January 21, 2022 13:57
Shell script aliases for git and sfdx commands
#!/bin/sh
# git
alias g='git'
alias gs='git status'
alias gc='git add . && git commit -m'
alias ga='git add . && git commit --amend --no-edit'
alias gl='git log --oneline'
alias gpush='git push'
alias gpull='git pull'
@sauloefo
sauloefo / regex-xml-remove.txt
Last active December 6, 2022 11:22
REGEX to remove references from xml files based on the outter xml node and a value to match
```
\n\s*<flowAccesses>\n([\S ]*\n){1}[\S ]*Play_Changed<[\S ]*\n([\S ]*\n){0}[\S ]*</flowAccesses>
```
{1} : number of lines *between* the outter open element and the line with the text to match;
< at the end of `Play_Changed<` : terminator to avoid matching text that starts with Play_Changed;
{0} : number of lines *between* the line with the text to match and the outter close element;
@sauloefo
sauloefo / gist:5ffeec553b42f28743ee21e8cacee32f
Last active April 25, 2019 10:48
Enable ES6 option in jsbin.com with a comment
//jshint esnext:true