Skip to content

Instantly share code, notes, and snippets.

@nedarb
nedarb / MakeRequired.d.ts
Last active November 17, 2022 23:25
TypeScript utility types that aren't built into TypeScript
/**
* Make all properties in T required
*/
declare type MakeRequired<T, K extends keyof T> = {
[P in K]-?: T[P];
} & Omit<T, K>;
@nedarb
nedarb / index.html
Created July 13, 2018 03:27
JS Bin ConcurrencyManager with takeANumber // source http://jsbin.com/zozoxac
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="ConcurrencyManager with takeANumber">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
@nedarb
nedarb / myLockerTest.cmp
Created January 18, 2018 22:43
Salesforce Lightning Locker test component
<aura:component implements="clients:availableForMailAppAppPage,clients:hasItemContext,flexipage:availableForAllPageTypes">
<aura:attribute name="window" type="String" access="private" />
<aura:attribute name="document" type="String" access="private" />
<aura:handler name="init" value="{! this }" action="{! c.init }" />
<aura:handler Name="change" value="{!v.messageBody}" action="{!c.handleMessageBodyChanged}" />
<!-- This has JQUERY included
<ltng:require scripts="https://code.jquery.com/jquery-3.2.0.min.js"/>
<br/> -->
<lightning:card title="Custom component show body">
<p class="slds-p-horizontal--small">
@nedarb
nedarb / myTest.cmp
Created April 3, 2017 20:26
Custom Salesforce Lightning for Outlook component
<aura:component implements="clients:availableForMailAppAppPage,clients:hasItemContext">
<div>
Subject:{!v.subject}<br/>
<ui:button label="Click" press="{!c.myAction}"/>
Body: {!v.messageBody}
</div>
</aura:component>
@nedarb
nedarb / cloudSettings
Last active July 18, 2019 17:31
Visual Studio Code Sync Settings GIST
{"lastUpload":"2019-07-18T17:31:30.684Z","extensionVersion":"v3.2.9"}
@nedarb
nedarb / RemoveEmptyFolders.ps1
Created January 28, 2016 05:04
Powershell to remove empty folders
$toDelete = Get-ChildItem . -recurse | Where-Object {$_.PSIsContainer -eq $True} | Where-Object {$_.GetFiles().Count -eq $_.GetFiles("*.ini").Count -and $_.GetDirectories().Count -eq 0} | Select-Object FullName
foreach ($dir in $toDelete) { Remove-Item $dir.FullName }
@nedarb
nedarb / HP Envy 14 brightness fix.reg
Created December 12, 2015 22:41
HP Envy 14 Beats Edition brightness fix
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000]
"KMD_EnableBrightnessInterface2"=dword:00000000