Skip to content

Instantly share code, notes, and snippets.

@swapnilshrikhande
swapnilshrikhande / webtorrent_demo.js
Last active December 11, 2024 19:01
WebTorrent Configure Custom STUN / TURN Server
var client = window.client = new WebTorrent({
tracker: {
rtcConfig: rtcConfig
}
})
client.on('warning', onWarning)
client.on('error', onError)
torrent = client.add(TORRENT, onTorrent)
@swapnilshrikhande
swapnilshrikhande / assign_hostname.bat
Created December 12, 2019 07:43
Windows : Assign hostname to a local ip
Update c:\Windows\System32\Drivers\etc\hosts
Add <Ip> <hostname1> <hostname2> entry
Save
@swapnilshrikhande
swapnilshrikhande / public-stun-list.txt
Created July 1, 2019 12:20 — forked from mondain/public-stun-list.txt
Public STUN server list
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
@swapnilshrikhande
swapnilshrikhande / relate.cls
Created June 7, 2019 09:39
Relationship without external id
// List<List<Contact>>
Contact contactR1 = new Contact(LastName='Test1');
Contact contactR2 = new Contact(LastName='Test2');
List<Contact> contactList = new List<Contact>{
contactR1,contactR2
};
@swapnilshrikhande
swapnilshrikhande / DynamicApexClassCreator.cls
Created June 6, 2019 11:47
Dynamically Pull And Create Apex Class From Github
HttpRequest req = new HttpRequest();
req.setEndpoint('https://raw.githubusercontent.com/swapnilshrikhande/nanoservices-libs/master/src/classes/HTTPNanoService.cls');
req.setMethod('GET');
Http http = new Http();
HTTPResponse res = http.send(req);
Map<String,String> createClassMap = new Map<String,String>{
'Name' => 'ExternalCalculatorNanoService'
, 'Body' => res.getBody()
};
@swapnilshrikhande
swapnilshrikhande / index.html
Created April 30, 2019 06:14
Slideshow using remark
<!DOCTYPE html>
<html>
<head>
<title>Slideshow</title>
<meta charset="utf-8">
<style>
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
@swapnilshrikhande
swapnilshrikhande / README.md
Last active May 19, 2022 04:29
System Development Analysis Checklist

Per Requirement Analysis Checklist

  1. Possible way to approach the requirements to frame right set of questions ? - [ ] Which is the core domain problem system will be resolving or we will be automating ?
    • Business Domain - Eg. Automating Sales Process
    • Technical Domain - Eg. CTI Integration, Salesforce Sales Cloud Implementation
    • What is the need of the system ?
    • Who are the end users of the system ?
    • Who are the super/admin users of the system ?
@swapnilshrikhande
swapnilshrikhande / Opportunity.trigger
Created April 3, 2019 08:44
Trigger Architecture
trigger Opportunity_AfterUpdate on Opportunity (after update) {
if (Settings.OPPORTUNITY_SETTING.Disable_All__c == true) {
return;
}
// Try to process transactions as needed
new Opportunity_ValidateTransactions(trigger.old, trigger.new).execute();
// ?
new Opportunity_RelateMatching(trigger.old, trigger.new).execute();
@swapnilshrikhande
swapnilshrikhande / README.MD
Created March 6, 2019 10:17
Introduction To Javascript Code Snippets
  1. Core Javascript

  2. DOM : HTML -> DOM - Tree Data Structure

    • window
      • document
  3. DOM API -> Manipulate DOM Tree Node

  • Selecting Nodes Selector Operators 1. dot
  1. hash
const ws = new WebSocket('ws://localhost:8080')
ws.onopen = () => {
console.log('Connected to the signaling server')
}
ws.onerror = err => {
console.error(err)
}