Skip to content

Instantly share code, notes, and snippets.

View tykauffman's full-sized avatar

Ty Kauffman tykauffman

View GitHub Profile
<div class="shw-bkg" style="display: none; z-index: 9999; position: fixed; top: 0; bottom: 0; left: 0; right: 0; background: #0000006e; text-align: center; padding: 50px 250px; 50px 250px"><iframe class="shw-widget" src="https://helpwidget.secure.force.com/" style="max-width: 100%; max-height: 100%; background: white;"></iframe></div>
<button class="shw-cta">Click me to pop up widget</button>
<script>
$(function() {
$(".shw-cta").on("click", function() {$(".shw-bkg").show();});
$(".shw-bkg").on("click", function() {$(".shw-bkg").hide();});
});
</script>
BaseDelete b = new BaseDelete('Case');
Database.executeBatch(b, 200);
public class BaseDelete implements Database.Batchable<Sobject>{
private String theObject;
public BaseDelete(String theObject) {
this.theObject = theObject;
}
public database.querylocator start(Database.BatchableContext bc) {
return Database.getQueryLocator('Select Id From ' + theObject + ' Where SCMT__DeskId__c != null');
@tykauffman
tykauffman / tls_widget.html
Last active January 10, 2018 14:34
This TLS widget attempts to detect whether the user's browser is compatible with TLS 1.1 or higher. If not, it prompts them to update their browser. If so, it lets them know they are good-to-go.
<style type="text/css">.tls-banner {
padding: 10px;
border-radius: 5px;
background: silver;
margin: 15px;
width: auto;
max-width: 250px;
font-size: 13px;
color: black;
}
@tykauffman
tykauffman / example.html
Last active December 19, 2017 21:31
Execute Javascript / jQuery based on the presence of GET parameters in the URL.
<script>
// –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
// Do not edit below this line
// –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
function $_GET(param) {
var vars = {};
window.location.href.replace(
/[?&]+([^=&]+)=?([^&]*)?/gi, // regexp
function( m, key, value ) { // callback
vars[key] = value !== undefined ? value : '';
<style>
.tls-banner {
padding: 10px;
border-radius: 5px;
background: silver;
margin: 15px;
width: auto;
max-width: 250px;
}
.tls-banner.success {
Is this about Twitch Prime or Amazon Prime? If so, please <strong><a href="javascript:void(0);" class="dropdown-focus">choose the Twitch Prime or Amazon Prime issue from the dropdown above.</a></strong>
<rss version="2.0">
<channel>
<title>zzz-ty.desk.com :: Test Topic 1</title>
<link>https://zzz-ty.desk.com/customer/en/portal/topics/939697-test-topic-1</link>
<description>Test Topic 1 articles</description>
<item>
<title>Test Article 1</title>
<description>This is a test article. The first one actually.</description>
<pubDate>Fri, 06 Jan 2017 16:13:23 +0000</pubDate>
<link> https://zzz-ty.desk.com/customer/en/portal/articles/2515094
@tykauffman
tykauffman / gist.html
Last active October 27, 2016 15:33
Click-to-Enlarge Images Within Articles - Paste this at the bottom of your web theme's Page (Article) section.
<!-- Magnific Popup core CSS file -->
<style>
/* Magnific Popup CSS */
.article-content img,
.container.article .body img {
cursor: pointer;
}
.mfp-bg {
<script>
$(function() {
$(".field input, .field select").prop("required", true)
});
</script>