Skip to content

Instantly share code, notes, and snippets.

IF EXISTS(select * from sysobjects where id = object_id('dbo.SP_ShrinkAllDatabasesOnServer') and xtype = 'P')
DROP PROCEDURE dbo.SP_ShrinkAllDatabasesOnServer
GO
CREATE PROCEDURE dbo.SP_ShrinkAllDatabasesOnServer
AS
BEGIN
CREATE TABLE #TempDatabasesTable
(
[DatabaseName] sysname not null primary key,
DECLARE @DatabaseName varchar(100), @SqlStatement varchar(1024)
SET ROWCOUNT 1
SELECT @DatabaseName = NAME FROM SYSDATABASES ORDER BY NAME
WHILE @@ROWCOUNT > 0
BEGIN
SET @SqlStatement = 'ALTER TABLE tblUsers ALTER COLUMN email nvarchar(250) NOT NULL'
SELECT @SqlStatement = 'Use [' + @DatabaseName + '] exec (' + @SqlStatement + ')'
PRINT (@SqlStatement)
SELECT @DatabaseName = NAME FROM SYSDATABASES WHERE NAME > @DatabaseName
DECLARE @DatabaseName varchar(100), @SqlStatement varchar(1024)
SET ROWCOUNT 1
SELECT @DatabaseName = NAME FROM SYSDATABASES ORDER BY NAME
WHILE @@ROWCOUNT > 0
BEGIN
-- Change this to your own SQL statement you want to execute against your db's
SET @SqlStatement = 'ALTER TABLE tblUsers ALTER COLUMN email nvarchar(250) NOT NULL'
SELECT @SqlStatement = 'Use [' + @DatabaseName + '] exec (' + @SqlStatement + ')'
-- Print the command to the screen
/// <summary>
/// Determines whether [is odd number] [the specified number].
/// </summary>
/// <param name="number">The number.</param>
/// <returns>
/// <c>true</c> if [is odd number] [the specified number]; otherwise, <c>false</c>.
/// </returns>
public static bool isOddNumber(int number)
{
if (number % 2 == 0)
/// <summary>
/// credit card number and an attached weight number
/// </summary>
public class CreditCardNumbers
{
public int number { get; set; }
public int weightNumber { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="CreditCardNumbers"/> class.
/// <summary>
/// Validates the VISA credit card.
/// </summary>
/// <param name="creditCardNumber">The credit card number.</param>
/// <returns></returns>
public static bool validateVISACreditCard(string creditCardNumber)
{
// this is a short credit card, the algorithm is unknown so return true
//ISRACARD
if (creditCardNumber.Length == 8 || creditCardNumber.Length == 9)
$(document).ready(function() {
$(".add_order").click(function() {
// do something
});
});
$(document).ready(function() {
$(".add_order").live('click', function() {
// do something
});
});
function loadAuctionOffers(saleID) {
$.getJSON("/HttpHandlers/AuctionOffersHandler.ashx?saleID=" + saleID + "&cacheKiller=" + Math.random(), function(json) {
var offers = $(".auction_offers_table").find("tr.row").length;
if (offers < json.length) {
playAlertSound();
$(".auction_offers_table").find("tr.row").remove();
for (var i = 0; i < json.length; i++) {
var auctionID = json[i].saleID;
var city = json[i].city;
@KensoDev
KensoDev / gist:1275668
Created October 10, 2011 15:52
Kill all resque workers with a sigle command
ps -e -o pid,command | grep [r]esque | sed 's/  */ /g' | cut -f2 -d' ' | xargs kill