Skip to content

Instantly share code, notes, and snippets.

View enreeco's full-sized avatar
☁️
Salesforcing...

Enrico Murru enreeco

☁️
Salesforcing...
View GitHub Profile
@tommyilpazzo
tommyilpazzo / reg_replace.sublime-settings
Created March 8, 2017 13:55
Sublime: RegReplace Settings
{
////////////////////////////////////////////////////////////////
// See reg_replace_rules.sublime-settings for regex rules.
////////////////////////////////////////////////////////////////
// Use sub notify if available
"use_sub_notify": true,
// If on_save is true, RegReplace will search through the file patterns listed below right before a file is saved,
// if the file name matches a file pattern, the sequence will be applied before the file is saved.
@tommyilpazzo
tommyilpazzo / Default.sublime-commands
Last active May 8, 2017 09:03
Sublime: RegReplace Commands
[
{
"caption": "Reg Replace: Apex Format All",
"command": "reg_replace",
"args": {
"replacements": [
"remove_empty_lines",
"add_empty_line_after_open_curly_bracket",
"add_empty_line_before_elseif",
"replace_system_debug",
{
"replacements": {
"remove_empty_lines": {
"find": "^\\s*\n",
"replace": "",
"greedy": true,
"case": false
},
"add_empty_line_after_open_curly_bracket": {
"find": "\\{\n",
@enreeco
enreeco / Apex_Sobject_member_to_null.cls
Last active March 13, 2017 19:02
Apex class behavior with Null instance of Sobject
/*
MyController cnt = new MyController();
cnt.tst.Name = 'test';
cnt.tst = null;
system.debug('Test outside: '+(cnt.tst.Name == null)); //Test outside: true
system.debug('Test outside: '+(cnt.tst == null)); //Test outside: true
system.debug('Test outside: '+json.serializepretty(cnt.tst)); //Test outside: null
cnt.myMethod(); //Throws null pointer exceptions
*/
public class MyController {
@pingud98
pingud98 / DUEUniqueID
Created December 4, 2016 16:59
How to get the Unique ID from an Arduino DUE board
/* Code borrowed from http://forum.arduino.cc/index.php?topic=289190.0
Awesome work Mark T!*/
__attribute__ ((section (".ramfunc")))
void _EEFC_ReadUniqueID( unsigned int * pdwUniqueID )
{
unsigned int status ;
@tommyilpazzo
tommyilpazzo / ApexClassDocHeader.apex
Last active May 6, 2017 18:13
SFDC: Apex class documentation header template
/**
* Class description
*
* @author Tommaso Bolis
* @version 1.0
* @description Class description
* @testedIn ClassNameTest
* @uses Class1, Class2
* @code
* @history
@ChadKillingsworth
ChadKillingsworth / e2e-shadowdom.md
Last active July 6, 2023 06:54
Selenium Testing with Shadow DOM

End-to-end Testing with Shadow DOM

As the web component specs continue to be developed, there has been little information on how to test them. In particular the /deep/ combinator has been deprecated in Shadow DOM 1.0. This is particularly painful since most end-to-end testing frameworks rely on elements being discoverable by XPath or calls to querySelector. Elements in Shadow DOM are selectable by neither.

WebDriver.io

Webdriver.io has the standard actions by selectors, but also allows browser executable scripts to return an element

@tommyilpazzo
tommyilpazzo / ObjectTriggerHandler.cls
Last active May 8, 2017 09:04
SFDC: Object Trigger Handler
/**
* Handler for Object Trigger
*
* @author Tommaso Bolis
* @version 1.0
* @code 001
*/
public with sharing class ObjectTriggerHandler {
private boolean m_isExecuting = false;
@tommyilpazzo
tommyilpazzo / ObjectTrigger.trigger
Last active May 6, 2017 18:13
SFDC: Object Trigger
/**
* Trigger on Object
*
* @author Tommaso Bolis
* @version 1.0
* @code 001
*/
trigger ObjectTrigger on Object (after delete, after insert, after undelete, after update, before delete, before insert, before update) {
objectTriggerHandler handler = new objectHandler();
@runspired
runspired / form.html
Created May 23, 2016 13:46
How to turn off password and email/username autocomplete.
<!--
<form autocomplete="off"> will turn off autocomplete for the form in most browsers
except for username/email/password fields
-->
<form autocomplete="off">
<!-- fake fields are a workaround for chrome/opera autofill getting the wrong fields -->
<input id="username" style="display:none" type="text" name="fakeusernameremembered">
<input id="password" style="display:none" type="password" name="fakepasswordremembered">