Skip to content

Instantly share code, notes, and snippets.

trigger ClosedOpportunityTrigger on Opportunity (before insert, before update) {
List<Task> newTask = new List <Task>();
//Grab the Opportunity Id's from Opps that are Closed Won from the Context Variable and store them in opp
for(Opportunity opp : [SELECT Id FROM Opportunity
WHERE StageName = 'Closed Won' IN :Trigger.New]){
//Create a Follow Up Task against Id's that are stored in the variable opp
newTask.add(new Task(Subject = 'Follow Up Test Task',
Priority = 'High',
@paustint
paustint / ApexUtils.cls
Last active May 7, 2024 15:51
Apex Utility Classes / CPQ Quote Calculator Plugin Example
/**
* Utility class for common operations
*
* Any classes that use Schema.SObjectField, this property is object by calling "Schema.Account.Description"
* This allows type safety to ensure that code will not break if fields are changed
* this will not work with person accounts
*
* (c) Advanced Technology Group, 2019
* This code may be used and modified freely as long as this copyright attribution
* is included with the code.
@anubhavshrimal
anubhavshrimal / CountryCodes.json
Last active May 7, 2024 15:48 — forked from Goles/CountryCodes.json
Country and Dial or Phone codes in JSON format
[
{
"name": "Afghanistan",
"dial_code": "+93",
"code": "AF"
},
{
"name": "Aland Islands",
"dial_code": "+358",
"code": "AX"
@resistancecanyon
resistancecanyon / multipleImageContentReader.js
Last active May 7, 2024 15:48
Reading Multiple Image Base64 data using Es6 Async/Await in a html:type:file input
// html
// <input type="file" onchange="imagesSelected" multiple accept=".gif,.jpg,.jpeg,.png" />
async function imagesSelected(event) {
let files = [...event.target.files];
let images = await Promise.all(files.map(f=>{return readAsDataURL(f)}));
//all images' base64encoded data will be available as array in images
}
function readAsDataURL(file) {
@crisu83
crisu83 / Example.kt
Last active May 7, 2024 15:47
A predictable state container (like Redux) written in Kotlin for use with Android view models.
data class CounterUiState(val counter: Int = 0) : State
sealed class CounterAction : Action {
object Increment : CounterAction()
object Decrement : CounterAction()
data class SetValue(val value: Int) : CounterAction()
}
class CounterViewModel : ViewModel() {
@imami
imami / anydesk-enable-remote-access.md
Last active May 7, 2024 15:47
AnyDesk - How Enable Remote Access from ubuntu/debian terminal

###AnyDesk - How Enable Remote Access from ubuntu/debian terminal.

Note:

Here are the commands might be usefull in this purpose:

  • anydesk --get-status : To get current status of anydesk, which might be offlien,online or nothing.
  • anydesk --get-id : To get the ID that your system can be accessed by.
  • anydesk --service : To start anydesk service if not already running (for Linux).
  • anydesk --restart-service : To restart anydesk service
  • anydesk --stop-service : To stop anydesk service
@jason-chandler
jason-chandler / init.lisp
Last active May 7, 2024 15:44
Basic .lem/init.lisp showing some ugly workarounds for getting cxxxr/valtan to work along with paredit and the monokai theme
(in-package :lem-user)
;; beautiful monokai
(define-color-theme "monokai" ()
(:foreground "#eeeeee")
(:background "#262626")
(cursor :foreground "#262626" :background "#eeeeee")
(syntax-warning-attribute :foreground "#87005f" :background "#262626")
(syntax-string-attribute :foreground "#d7d787" :background "#262626")
(syntax-comment-attribute :foreground "#666666" :background "#262626")
The Yale VPN uses Cisco AnyConnect.
If Cisco's Linux client works for you, congratulations.
If, like me, the official client leaves you stranded, then you need to install
OpenConnect and (assuming you are using Network Manager) the appropriate add-on for the NM applet.
On a Debian-based system, you can type the following command:
$ sudo apt-get install openconnect network-manager-openconnect network-manager-openconnect-gnome
@ripperhe
ripperhe / README.md
Created October 28, 2022 05:02 — forked from IsaacXen/README.md
(Almost) Every WWDC videos download links for aria2c.
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 7, 2024 15:39
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example