Skip to content

Instantly share code, notes, and snippets.

View priore's full-sized avatar

Priore priore

View GitHub Profile
@priore
priore / gist:7163673
Created October 25, 2013 23:59
Send an email with GMail account and CDO Components
'
' Created by Danilo Priore.
' Copyright (c) 2012 Prioregroup.com. All rights reserved.
'
'
' Permission is hereby granted, free of charge, to any person obtaining a copy
' of this software and associated documentation files (the "Software"), to deal
' in the Software without restriction, including without limitation the rights
' to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
' copies of the Software, and to permit persons to whom the Software is
@priore
priore / gist:7163664
Created October 25, 2013 23:59
Execute a DTS from SQL
--
-- Created by Danilo Priore.
-- Copyright (c) 2012 Prioregroup.com. All rights reserved.
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
@priore
priore / gist:7163659
Created October 25, 2013 23:58
Copy files with SQL
--
-- Created by Danilo Priore.
-- Copyright (c) 2012 Prioregroup.com. All rights reserved.
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
@priore
priore / gist:7163654
Created October 25, 2013 23:58
Get binary files from SQL
--
-- Created by Danilo Priore.
-- Copyright (c) 2012 Prioregroup.com. All rights reserved.
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
@priore
priore / gist:7163646
Created October 25, 2013 23:56
Add a gift shop to your iOS application
// With MYZazzleStore SDK it's really simple to add a gift shop to your application for your users.
// With a few lines of code you can give your users the opportunity to purchase T-shirts personalized
// mugs, iphone / ipad covers and other types of gifts. It also allows you to increase financial gains
// and increase the popularity of your products.
MYZazzleStore myStore = [[MYZazzleStore alloc] initWithFrame:CGRectMake(0, 50, 320, 410)];
myStore.imageLink = @"http://www.my-domain.com/my-image.png";
// your Zazzle ID, this will allow you to earn referral on purchases (optional)
myStore.accountId = 1234567890;
[myStore reload];
@priore
priore / gist:7163642
Created October 25, 2013 23:56
Add a gift shop to your ASP.NET application
// With MYZazzleStore Library for ASP.NET it's really simple to add a gift shop to your ASP.NET application for your users.
// With a few lines of code you can give your users the opportunity to purchase T-shirts personalized
// mugs, iphone / ipad covers and other types of gifts. It also allows you to increase financial gains
// and increase the popularity of your products.
//
// look for source code : https://github.com/priore/MYZazzleStore-for-ASP.NET
//ASP.NET page
<%@ Register Assembly="Priore.Web.MYZazzleStore"
@priore
priore / gist:7163636
Created October 25, 2013 23:55
cocos2d: menu level in Angry Birds style
//
// Created by Danilo Priore on 10/06/12.
// Copyright 2012 Prioregroup.com. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@priore
priore / gist:7163631
Created October 25, 2013 23:54
DataReader AsEnumerable (LINQ) with fields name
// create a static class
public static class DataReaderExtension
{
public static IEnumerable<Dictionary<string, object>> AsEnumerable(this System.Data.IDataReader source)
{
if (source == null)
throw new ArgumentNullException("source");
while (source.Read())
{
@priore
priore / gist:7163627
Created October 25, 2013 23:54
Generate random password from GUID
// generate random password from GUID
string password = string.Empty;
string guid = Guid.NewGuid().ToString().Replace("-", string.Empty);
Random random = new Random(DateTime.Now.Millisecond);
for (int i = 0; i < 8; i++)
password += guid.Substring(random.Next(0, guid.Length - 1), 1);
@priore
priore / gist:7163626
Created October 25, 2013 23:53
Add text to UIImage
//
// Created by Danilo Priore on 18/08/12.
// Copyright (c) 2012 Prioregroup.com. All rights reserved.
//
- (UIImage*)addTextToImage:(UIImage*)img text:(NSString*)text1 XPos:(int)xpos YPos:(int)ypos fontName:(NSString*)fontName fontSize:(CGFloat)fontSize fontColor:(UIColor*)fontColor {
int w = img.size.width;
int h = img.size.height;