Skip to content

Instantly share code, notes, and snippets.

Gabe Sumner gabesumner

  • Salesforce
  • San Francisco, CA
View GitHub Profile
@gabesumner
gabesumner / Heroku.js
Last active Sep 17, 2018
DF18 Platform TM Scripts
View Heroku.js
// ==UserScript==
// @name Heroku Autocomplete Private Space
// @version 0.1
// @match https://dashboard.heroku.com/teams/align-technologies*
// @require https://code.jquery.com/jquery-3.3.1.min.js
// @grant none
// ==/UserScript==
function rewrite() {
$(".alert-warning").hide();
@gabesumner
gabesumner / gist:a8a3ac290fae1acc02f33479caf2a896
Last active Mar 16, 2018
TamperMonkey Heroku Search/Replace Names
View gist:a8a3ac290fae1acc02f33479caf2a896
// ==UserScript==
// @name         TamperMonkey Heroku Search/Replace Names
// @match       https://dashboard.heroku.com/*
// @grant none
// ==/UserScript==
function replaceDreamhouse() {
var replaceArry = [
[/dreamhouse/gi, 'pecten']
];
@gabesumner
gabesumner / sfdx
Last active Aug 31, 2018
A small bash script that provides shortcuts for several common Salesforce DX commands.
View sfdx
#!/bin/bash
case $1 in
list)
# sfdx list
/usr/local/bin/sfdx force:org:list
;;
push)
if [ "$2" == "over" ]
then
@gabesumner
gabesumner / worst-practice.html
Created Jul 27, 2012
Worst practices for creating a CMS template design
View worst-practice.html
<!doctype html>
<html>
<head>
<title>Sushi Mockup</title>
<!-- Nothing wrong with this block of styling. Collapse or keep scrolling. -->
<style type="text/css">
*
{
margin: 0;
padding: 0;
@gabesumner
gabesumner / gist:2148657
Created Mar 21, 2012
Provides a short URL slug based on the database row ID. This is done by converting a (Base10) Int into a (Base64) String
View gist:2148657
using System;
using System.Linq;
using System.Text.RegularExpressions;
namespace MvcApplication.Helpers
{
public static class ShortUrl
{
/// <summary>
/// Converts a Base-10 Integer to Base-64. This will effectively shorten the number of characters used to represent a number > 10.
@gabesumner
gabesumner / Responsive-Hello-World.html
Created Feb 15, 2012
Hello World introduction to Responsive Design
View Responsive-Hello-World.html
<!DOCTYPE html>
<html>
<head>
<title>Hello World introduction to Responsive Design</title>
<style type="text/css">
body {
background-color: #eee;
}
#content {
@gabesumner
gabesumner / DisqusExport.aspx
Created Feb 12, 2012
Import Disqus Comments from Sitefinity 3
View DisqusExport.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Use Ctrl + A to select All, then Paste into Notepad. This is your XML export file.</title>
</head>
<body>
<form id="form1" runat="server">
@gabesumner
gabesumner / fiddle.css
Last active Oct 24, 2018
Address Validation using the Google Maps API
View fiddle.css
body {
font: 12px verdana;
background-color: #5C87B2;
}
form {
max-width: 400px;
padding: 15px;
background-color: white;
}
@gabesumner
gabesumner / WordPressImport.ascx
Created Feb 10, 2012
Importing WordPress Export files into Sitefinity CMS (VERY unfinished)
View WordPressImport.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WPimport.ascx.cs" Inherits="SitefinityWebApp.Widgets.WPimport" %>
<div>
<div style="color: red;">
<asp:Literal ID="Error" Visible="false" runat="server" />
</div>
<div>
<asp:Label AssociatedControlID="WordPressFile" runat="server">WordPress Export File: </asp:Label>
@gabesumner
gabesumner / gist:1243069
Created Sep 26, 2011
SQL for renaming the database schema
View gist:1243069
USE clickonpublish
DECLARE @OldSchema AS varchar(255)
DECLARE @NewSchema AS varchar(255)
SET @OldSchema = 'dbo'
SET @NewSchema = 'clickonpublish'
DECLARE @sql AS varchar(MAX)
You can’t perform that action at this time.