This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NHContext :IDisposable | |
{ | |
#region init | |
protected static ISessionFactory _sessionFactory; | |
public ISessionFactory SessionFactory { | |
get { | |
if (_sessionFactory == null) Init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$siteUrl = "http://sharepoint/" | |
$listName = "Site Assets" | |
$fileName = "OfferApp.xap" | |
$filePath = "OfferApp.Web\ClientBin\" + $fileName | |
[system.reflection.assembly]::LoadWithPartialName("Microsoft.Sharepoint") | |
$site = New-Object Microsoft.SharePoint.SPSite($siteUrl) | |
$web = $site.OpenWeb() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' | |
include System::DirectoryServices | |
class WinManager | |
attr_accessor :connection_string | |
if !defined? FLAG_CANNOT_CHANGE_PASSWORD | |
FLAG_CANNOT_CHANGE_PASSWORD = 0x40 | |
FLAG_PASSWORD_NEVER_EXPIRES = 0x10000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' | |
require 'Microsoft.SharePoint.Security, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' | |
include Microsoft::SharePoint | |
include Microsoft::SharePoint::Administration | |
class SPManager | |
attr_reader :site_collection_url | |
def initialize url | |
@site_collection_url = url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$hostname = hostname | |
#create new user | |
$comp = [adsi] "WinNT://$hostname" | |
$user = $comp.Create("User", "mdn") | |
$user.Put("description", "$username") | |
$user.SetPassword("Password1") | |
$user.SetInfo() | |
$user.psbase.invokeset("AccountDisabled", "False") | |
$user.SetInfo() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[system.reflection.assembly]::LoadWithPartialName("Microsoft.Sharepoint") | |
$siteUrl = "http://sharepoint/" | |
$site = New-Object Microsoft.SharePoint.SPSite($siteUrl) | |
$web = $site.rootweb | |
$email = 'mdnmdn@mymail.com' | |
$username = 'mdn' | |
$u = $web.EnsureUser($username) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @_id int | |
DECLARE CUR CURSOR FOR | |
select id from table_name | |
OPEN CUR; | |
FETCH NEXT FROM CUR into @_id; | |
WHILE @@FETCH_STATUS = 0 | |
BEGIN | |
PRINT cast(@_id as varchar) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#OS junk files | |
[Tt]humbs.db | |
*.DS_Store | |
#Visual Studio files | |
*.[Oo]bj | |
*.user | |
*.aps | |
*.pch | |
*.vspscc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -rf ../tmp/dm/* | |
git archive 1c1a6aacbdedc3a | tar -xC ../tmp/dm | |
git archive master | tar -xC ../tmp/dm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sp_configure 'Ole Automation Procedures', 1; | |
GO | |
RECONFIGURE; | |
GO | |
CREATE function fn_get_http | |
( | |
@url varchar(8000) | |
) | |
returns varchar(8000) |
OlderNewer