This file contains hidden or 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
""" | |
Created on Sep 24, 2013 | |
@author: RandomHardcoreJerks | |
Requires pywin32 | |
original: http://code.activestate.com/recipes/474121/ | |
# HtmlClipboard |
This file contains hidden or 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
class Foo(object): | |
def __init__(self): | |
self.__baz = 42 | |
def foo(self): | |
print self.__baz | |
class Bar(Foo): | |
def __init__(self): | |
super(Bar, self).__init__() | |
self.__baz = 21 |
This file contains hidden or 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
foo = "[email protected]" | |
foo.split('@')[0] |
This file contains hidden or 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
$comps = @("comp2", "comp1") | |
$comps | Foreach { | |
if(Test-Connection $_ -q -count 1){ | |
$user = Get-WMIObject Win32_UserAccount -computername $_ -Filter "Name='@oldname'" | |
$result = $user.Rename('@newname') | |
if ($result.ReturnValue -eq 0) { | |
return Get-WMIObject Win32_UserAccount -computername $_ -Filter "Name='@newname'" | |
} | |
} |
This file contains hidden or 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
$user = Get-WMIObject Win32_UserAccount -Filter "Name='$oldName'" | |
$result = $user.Rename($newName) | |
if ($result.ReturnValue -eq 0) { | |
return $user | |
# you may just print a message here | |
} |
This file contains hidden or 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
SELECT TOP 10 * | |
FROM Table | |
ORDER BY NEWID() |
NewerOlder