Skip to content

Instantly share code, notes, and snippets.

Avatar

Joe Coleman phantom42

View GitHub Profile
@phantom42
phantom42 / HNQHider.js
Created Jul 27, 2017
This GreaseMonkey script hides the Hot Network Questions from StackOverflow and the StackExchange network.
View HNQHider.js
// ==UserScript==
// @name HNQ Hider
// @namespace colemancodes.com
// @description Hides Stackexchange HNQ
// @include *://*.stackexchange.com/*
// @include *://*.stackoverflow.com/*
// @version 1
// @grant none
// ==/UserScript==
document.getElementById('hot-network-questions').style.display = 'none';
@phantom42
phantom42 / logger.sublime-snippet
Last active Jul 22, 2016
logger snippet for sublimetext. type "logger" and hit TAB. then TAB through to each of the fields to replace logging markers. instructions: Tools -> New Snippet -> (paste this in) -> save
View logger.sublime-snippet
<snippet>
<content><![CDATA[
<cflog text='$TM_FILENAME ${1:mark} ${2:1}' file='${3:application}'>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>logger</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>text.html.cfm</scope> -->
</snippet>
@phantom42
phantom42 / cfdump-sublime-snippet
Last active May 11, 2016
instructions: Tools -> New Snippet -> (paste this in) -> save
View cfdump-sublime-snippet
<snippet>
<content><![CDATA[
<cfdump var="$1" label="$2" format="html" output="${3:c:\debug.html}" expand="${4:false}">
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>dumpvar</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>text.html.cfm</scope>
</snippet>
@phantom42
phantom42 / Sachin Schekar names
Last active Apr 26, 2018
Deleted/Renamed SF/F UserIDs
View Sachin Schekar names
============================================
|Name | Est Date |
============================================
|Sachin Shekar | Aug 2012 |
|SS-3.1415926535897932384626433 | Nov 2015 |
|SS-3 | Jan 2016 |
|I Love You | Apr 2017 |
|I Am Groot | May 2017 |
|Sachin Stark | Jul 2017 |
|Atomic Blonde | Aug 2017 |
@phantom42
phantom42 / coldfusion.sublime-keymap.txt
Created Dec 2, 2015
sublime keymap contents for coldfusion. makes sublime similar to cfbuilder. enter this in preferences -> package settings -> coldfusion -> key bindings user
View coldfusion.sublime-keymap.txt
[
// cf tags
{ "keys": ["ctrl+shift+a"], "command": "insert_snippet", "args": {"contents": "<cfabort>" } },
{ "keys": ["ctrl+shift+d"], "command": "insert_snippet", "args": {"contents": "<cfdump var=\"#${0:$SELECTION}#\">" }},
{ "keys": ["ctrl+shift+o"], "command": "insert_snippet", "args": {"contents": "<cfoutput>${0:$SELECTION}</cfoutput>"}} ,
// comments & wrappers
// hash
{ "keys": ["ctrl+shift+h"], "command": "insert_snippet", "args": {"contents": "#${0:$SELECTION}#" } },
// single line comment
@phantom42
phantom42 / cfdump.html
Last active Aug 29, 2015
corrected headers for use when pasting a cfdump from a log file
View cfdump.html
<html>
<head>
<style>
table.cfdump_wddx,
table.cfdump_xml,
table.cfdump_struct,
table.cfdump_array,
table.cfdump_query,
table.cfdump_cfc,
@phantom42
phantom42 / .gitattributes
Last active Aug 29, 2015
how to deal with line crlf issues in git
View .gitattributes
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.h text
# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf
@phantom42
phantom42 / indexOf.js
Created May 23, 2014
indexOf function for browsers lacking support (looking at you IE < 9). From answer on SO. http://stackoverflow.com/questions/143847/best-way-to-find-an-item-in-a-javascript-array#144172
View indexOf.js
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (obj, fromIndex) {
if (fromIndex == null) {
fromIndex = 0;
} else if (fromIndex < 0) {
fromIndex = Math.max(0, this.length + fromIndex);
}
for (var i = fromIndex, j = this.length; i < j; i++) {
if (this[i] === obj)
return i;
@phantom42
phantom42 / where_case.sql
Created Mar 6, 2014
working CASE statement within a WHERE clause
View where_case.sql
DECLARE
v_filter varchar2(20) := 'All';
v_count number := 0 ;
BEGIN
dbms_output.enable(100000) ;
DBMS_output.put_line('running') ;
SELECT count(1) into v_count
FROM personnel p
WHERE NVL(P.TERMINATED_FLAG,'N') = 'N'
AND CASE WHEN (v_filter = 'Federal') THEN
@phantom42
phantom42 / with_as.sql
Created Feb 19, 2014
oracle "with as" subquery
View with_as.sql
WITH typelist AS
(SELECT 0 AS n
FROM DUAL
WHERE 1 = 0
UNION
SELECT 1 AS n
FROM DUAL
UNION
SELECT 2 AS n
FROM DUAL)
You can’t perform that action at this time.