Skip to content

Instantly share code, notes, and snippets.

@phantom42
phantom42 / HNQHider.js
Created July 27, 2017 04:00
This GreaseMonkey script hides the Hot Network Questions from StackOverflow and the StackExchange network.
// ==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 July 22, 2016 13:43
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
<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 14:26
instructions: Tools -> New Snippet -> (paste this in) -> save
<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 April 26, 2018 17:28
Deleted/Renamed SF/F UserIDs
============================================
|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 December 2, 2015 13:52
sublime keymap contents for coldfusion. makes sublime similar to cfbuilder. enter this in preferences -> package settings -> coldfusion -> key bindings user
[
// 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 August 29, 2015 14:26
corrected headers for use when pasting a cfdump from a log file
<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 August 29, 2015 14:23
how to deal with line crlf issues in git
# 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 15:07
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
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 March 6, 2014 16:58
working CASE statement within a WHERE clause
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 February 19, 2014 14:34
oracle "with as" subquery
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)