Skip to content

Instantly share code, notes, and snippets.

Chris Emerson cemerson

Block or report user

Report or block cemerson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cemerson
cemerson / git-branch-to-master.md
Created Jan 29, 2020
GIT: push branch to master remote
View git-branch-to-master.md

// https://stackoverflow.com/a/5434370/826308 git checkout master git pull # to update the state to the latest remote master state git merge develop # to bring changes to local master from your develop branch git push origin master # push current HEAD to remote master branch

@cemerson
cemerson / TSQL-Get DB rowcount and filesize.sql
Created Oct 10, 2019
TSQL: Query to get row count and KB/MB file space usage of SQL database
View TSQL-Get DB rowcount and filesize.sql
-- https://stackoverflow.com/a/7892349/826308
SELECT
t.NAME AS TableName,
s.Name AS SchemaName,
p.rows AS RowCounts,
SUM(a.total_pages) * 8 AS TotalSpaceKB,
CAST(ROUND(((SUM(a.total_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS TotalSpaceMB,
SUM(a.used_pages) * 8 AS UsedSpaceKB,
CAST(ROUND(((SUM(a.used_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS UsedSpaceMB,
(SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB,
@cemerson
cemerson / dissenter-adblock-plus-settings-export.md
Last active Sep 17, 2019
Copy Adblock Plus settings to another machine
View dissenter-adblock-plus-settings-export.md

Copying Adblock Plus settings from one Chrome browser to another

Steps below are for Dissenter so replace \GabAI\Dissenter\ below with \Google\Chrome\ if you use their version of Chrome.

  1. Close your browser on the TARGET machine
  2. (Backup if you want then) Delete contents of this folder on the TARGET machine: C:\Users\YourUsername\AppData\Local\GabAI\Dissenter\User Data\Default\Local Extension Settings\cfhdojbkjhnklbpkdaibdccddilifddb
  3. Copy the files from the same folder above on the SOURCE machine and copy them into the folder you just emptied in step #2 above
  4. Start your browser on the TARGET machine and test your Adblock Plus settings. With any luck, like me, your Adblock Plus settings/filters will have been copied over!
View sso-metadata-file-example.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><EntityDescriptor entityID="mainsite.com/portalfolder" xmlns="urn:oasis:names:tc:SAML:2.0:metadata"><SPSSODescriptor AuthnRequestsSigned="false" WantAssertionsSigned="true" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol"><NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</NameIDFormat><AssertionConsumerService index="0" isDefault="true" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://mainsite.com/portalfolder/login"/></SPSSODescriptor></EntityDescriptor>
View salesforce-fake-apex-test-methods.cls
/* STRUCTURE OF APEX TEST CLASS */
private class MyClassTest{
static testMethod void fakeTests(){
MyCLSSessions.fakeMethod1();
MyCLSSessions.fakeMethod2();
MyCLSSessions.fakeMethod3();
MyCLSSessions.fakeMethod4();
MyCLSSessions.fakeMethod5();
MyCLSSessions.fakeMethod6();
MyCLSSessions.fakeMethod7();
@cemerson
cemerson / package.xml
Created Aug 13, 2019
SFDC package.xml example (all/most items included)
View package.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>ApexClass</name>
</types>
<types>
<members>*</members>
<name>ApexComponent</name>
</types>
View sfdx-project.json
{
"packageDirectories": [
{
"path": "src",
"default": true
}
],
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "45.0"
@cemerson
cemerson / animate-background-position-jquery.js
Created Jul 7, 2019
jQuery Animate Background Postion (CSS)
View animate-background-position-jquery.js
// https://stackoverflow.com/questions/12340130/jquery-animate-background-image-on-y-axis
$.fn.animateBG = function(x, y, speed) {
var pos = this.css('background-position').split(' ');
this.x = pos[0].split('px')[0] || 0;
this.y = pos[1].split('px')[0] || 0;
$.Animation( this, {
x: x,
y: y
}, {
duration: speed
View el-ebin-bitchute-downloader.user.js
// ==UserScript==
// @name el ebin bitchute downloader
// @namespace http://tampermonkey.net/
// @version 0.1
// @description no homo
// @author jeff@i2p.rocks (cemerson 20190516 update)
// @match https://www.bitchute.com/video/*
// @grant none
// ==/UserScript==
@cemerson
cemerson / Make-Dissenter-Windows-10-Default-Browser.md
Last active Jun 17, 2019
Set Windows 10 Default Browser to Dissenter
View Make-Dissenter-Windows-10-Default-Browser.md

Set Dissenter as Default Browser in Windows 10


Problem

As of 2019051x Dissenter still not showing up in Windows 10's list of browsers so you can't set it to be the default browser using the standard Windows 10 UI.

Steps

  1. Download SetDefaultBrowser 1.3 from here: http://kolbi.cz/SetDefaultBrowser.zip
You can’t perform that action at this time.