Skip to content

Instantly share code, notes, and snippets.

View nikitakarpenkov's full-sized avatar

Nikita Karpenkov nikitakarpenkov

View GitHub Profile
@nikitakarpenkov
nikitakarpenkov / create-destructive-changes.sh
Created February 2, 2022 07:32 — forked from gbutt/create-destructive-changes.sh
Destructive changes using git diff
#!/bin/bash
write_xml () {
local type_name="$1"
shift
local type_arry=("$@")
XML="${XML}\n\t<types>\n\t\t<name>${type_name}</name>"
for FILENAME in "${type_arry[@]}"; do
XML="${XML}\n\t\t<members>${FILENAME}</members>"
done
@nikitakarpenkov
nikitakarpenkov / SendEmailBatchable.java
Created November 27, 2018 10:07 — forked from douglascayers/SendEmailBatchable.java
Example Apex classes to enable Process Builder to send emails without using Email Alerts + Templates or launching a Flow.
/**
* Developed by Doug Ayers
* douglascayers.com
*
* Designed to be used by SendEmailInvocable class when sending
* several emails but need to stay within the apex governor limits
* of how many emails can be sent per transaction. Call this batchable
* with all the emails to send and set the batch size to max per transaction.
* https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_apexgov.htm
*
@nikitakarpenkov
nikitakarpenkov / firebase-delete-all-users.js
Last active October 24, 2018 08:52
Script to delete all firebase users using firebase admin SDK
const admin = require('firebase-admin');
admin.initializeApp();
function deleteAllUsers(nextPageToken) {
admin.auth().listUsers(10, nextPageToken)
.then(function(listUsersResult) {
listUsersResult.users.forEach(function(userRecord) {
admin.auth().deleteUser(userRecord.uid).then(() => {
console.log(`deleted ${userRecord.uid}`);
});
@nikitakarpenkov
nikitakarpenkov / RSA.cls
Last active May 2, 2024 21:49 — forked from karmats/RsaEncryption.cls
RSA encryption / decryption in salesforce apex
public class RSA {
private Key key;
// Hex digits
private static final String DIGITS = '0123456789abcdef';
private static final Decimal HEX_BASE = 16;
public abstract class Key {
private String modulus;
public Key(String modulus) {