Skip to content

Instantly share code, notes, and snippets.

View bennadel's full-sized avatar
💭
Life's a garden, dig it!

Ben Nadel bennadel

💭
Life's a garden, dig it!
View GitHub Profile
@bennadel
bennadel / select.htm
Created March 21, 2014 11:45
Using Transparent Select Menus To Create Styled Menu Roots
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>
Using Transparent Select Menus To Create Styled Menu Roots
</title>
<style type="text/css">
@bennadel
bennadel / code-1.txt
Created March 24, 2014 22:53
Dude! I just posted this!
Woot!
@bennadel
bennadel / code-1.cfm
Created March 24, 2014 22:54
Turning Off and On Identity Column in SQL Server
<!--- Update the data records. --->
<cfquery name="qTurnOnInsert" datasource="#DATA.Source#" username="#DATA.Username#" password="#DATA.Password#">
<!--- Delete the data in the table. --->
DELETE FROM
[#strTableName#]
;
<!--- Turn on the ability insert the identity column. --->
SET IDENTITY_INSERT [#strTableName#] ON
;
@bennadel
bennadel / code-1.cfm
Created March 24, 2014 22:54
Turning Off Session Management for Web Spiders
// Define the application. To stop unnescessary memory usage, we are going to give
// web crawler no session management. This way, they don't have to worry about cookie
// acceptance and object persistance (except for APPLICATION scope).
if ((NOT Len(CGI.http_user_agent)) OR REFindNoCase("Slurp|Googlebot|BecomeBot|msnbot|Mediapartners-Google|ZyBorg|RufusBot|EMonitor|researchbot|IP2MapBot|GigaBot|Jeeves|Exabot|SBIder|findlinks|YahooSeeker|MMCrawler|MJ12bot|OutfoxBot|jBrowser|ZiggsBot|Java|PMAFind|Blogbeat|TurnitinBot|ConveraCrawler|Ocelli|ColdFusion", CGI.http_user_agent)){
// This application definition is for robots that do NOT need sessions.
THIS.Name = "KinkySolutions v.1 {dev}";
THIS.SessionManagement = false;
THIS.SetClientCookies = false;
THIS.ClientManagement = false;
@bennadel
bennadel / code-1.js
Created March 24, 2014 22:54
Hidden Input Ordering in FireFox Form Submission
function UpdateValueList( objRow ){
var objForm = document.forms[0];
var objValueList = objForm.elements["lst_id"];
var objTBody = objRow.parentNode;
var intI = null;
var objInput = null;
// Reset value list.
objValueList.value = "";
@bennadel
bennadel / code-1.js
Created March 24, 2014 22:55
Calling Sub-Function in Javascript Different in Safari
// This will NOT work in safari.
function Foo2(){
alert("In Foo2 Method");
(
function Bar2(){
alert("In Bar2 Method");
}
)();
}
@bennadel
bennadel / code-1.js
Created March 24, 2014 22:56
Javascript Regular Expression (RegExp) Multiline Flag Not Universal
new RegExp("[\\n\\r]+", "gim")
@bennadel
bennadel / code-1.js
Created March 24, 2014 22:57
Using Methods in Javascript Replace Method
// Turns the vowel characters into random cases.
String.prototype.RandomCase = function(){
return(
this.replace(
new RegExp("([aeiou]{1})", "gi"),
// Here, we are passing in a nameless function as the parameter for
// the "replace" argument of the String Replace method. It uses the $1
// to refer to the grouping of vowels found in the regular expression.
function($1){
// Get a random number.
@bennadel
bennadel / code-1.htm
Created March 24, 2014 22:59
FireFox Fires OnClick Handler for Submit Buttons
<input type="submit" value="Save" onclick="alert('This will fire in FireFox');" />
@bennadel
bennadel / code-1.cfm
Created March 24, 2014 23:00
The Processing Instruction Target Matching "[xX][mM][lL]" is Not Allowed
<cfxml variable="REQUEST.Response"
><?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
...
...
</cfxml>