Skip to content

Instantly share code, notes, and snippets.

View swaters86's full-sized avatar
🏠
Kicking ass and taking names

Steve Waters swaters86

🏠
Kicking ass and taking names
View GitHub Profile
//Based on: http://stackoverflow.com/questions/5371089/count-characters-in-textarea
saxoJQuery(document).ready(function () {
//Character limit box container
var charBox = ''
charBox += '<div>';
charBox += '<div style="width:100%;margin-left:120px;text-align:right">';
charBox += '<strong>Characters Left: </strong>';
charBox += '<label id="charNum" style="color:green;font-weight:bold">500</label>';
charBox += '</div>';
$userAgentString = $SOSE->ENV("USERAGENT");
if (preg_match("/iOpus/i", $userAgentString)) {
//$SOSE->Echo("A match was found.");
$ipaddress = $SOSE->ENV("CLIENTIP");
$fp = fopen('\\\\sxatl\\sx1\\SX1\\Web\\FD\\logs\\spammeripaddress.txt', 'w');
fwrite($fp, "ip addrss is: " . $ipaddress );
fclose($fp);
/* select by cceobjectguid */
select top 100 *
from cce.dbo.CCE_Objects aa (nolock)
inner join cce.dbo.CCE_Status bb (nolock)
on aa.Site = bb.Site and aa.Module = bb.Module and aa.Class = aa.Class and aa.RowGUID = bb.CCEObjectGUID
where aa.Site='PN' and aa.Module='3' and aa.Class='301' and bb.CCEObjectGUID='8EBB449B-427E-4CBE-9C87-154C042A3970'
/* select by title */
select top 100 *
from cce.dbo.CCE_Objects aa (nolock)
USE [custom]
GO
/****** Object: StoredProcedure [dbo].[usp_web_GetMostClicked_SSW] Script Date: 04/27/2012 15:35:06 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[usp_web_GetMostClicked_SSW]
@tcSiteCode char (4),
<!doctype html>
<html lang="en">
<head>
<title>Title</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" src="//normalize-css.googlecode.com/svn/trunk/normalize.css" />
<link type="text/css" href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
</head>
@swaters86
swaters86 / Item randomizer and remover
Created August 26, 2014 13:14
Randomize List Using jQuery and remove all items after the 4th item in the list.
<!doctype html>
<html>
<head>
<title>Randomize List Using jQuery</title>
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<style type="text/css">
.list {
width:600px;
margin:0 auto;
@swaters86
swaters86 / gist:a5b3ba4c2580a46c4a90
Last active August 29, 2015 14:05
Learning JavaScript
// Most of this was taken from this awesome blog post: https://www.discovermeteor.com/blog/javascript-for-meteor/?utm_content=bufferf9e86&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer
// If you happen to the be the author of this blog post and you don't like how I just scaped it and put all of this code in this Gist then please feel free to email me at swaters86@gmail.com and let me know that I should take it down.
// Other sources:
// https://developer.mozilla.org/en-US/docs/Web/JavaScript
// http://addyosmani.com/resources/essentialjsdesignpatterns/book/#prototypepatternjavascript
// How to declare a variable
var a;
netstat -a -n | findstr ":25"
:: -n ensures all ports will be numerical, i.e. not returned as translated to service names.
:: -a will ensure you search all connections (TCP, UDP, listening...)
:: In the find string you must include the colon, as the port qualifier, otherwise the number may match either local or foreign addresses.
declare @Asite varchar(2)
set @Asite = 'mb'
/* articles */
select COUNT(*) Articles
from web.dbo.Artikkler (nolock)
where Avis=@Asite
/*teasers*/
declare
@Site varchar(2),
@BlogEntries tinyint,
@InclStories tinyint,
@InclGalleries tinyint,
@InclCCE tinyint,
@DatoFromDate varchar(8),
@DatoToDate varchar(8),
@CreatedFromDateTime datetime,
@CreatedToDateTime datetime,