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
#How to install the Active Directory module for Powershell | |
#Source: https://blogs.technet.microsoft.com/ashleymcglone/2016/02/26/install-the-active-directory-powershell-module-on-windows-10/ | |
# Download the script referenced in the post and follow the directions |
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
; IMPORTANT INFO ABOUT GETTING STARTED: Lines that start with a | |
; semicolon, such as this one, are comments. They are not executed. | |
; This script has a special filename and path because it is automatically | |
; launched when you run the program directly. Also, any text file whose | |
; name ends in .ahk is associated with the program, which means that it | |
; can be launched simply by double-clicking it. You can have as many .ahk | |
; files as you want, located in any folder. You can also run more than | |
; one .ahk file simultaneously and each will get its own tray icon. |
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
int value = conn.Query<int>(sql, args).Single(); | |
string value = conn.Query<string>(sql, args).Single(); | |
http://stackoverflow.com/questions/8050636/is-there-an-executescalar-in-dapper |
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 Program | |
{ | |
public static SqlConnection GetOpenConnection() | |
{ | |
var dapperConnString = ConfigurationManager.ConnectionStrings["DapperConn"].ConnectionString; | |
var connection = new SqlConnection(dapperConnString); | |
connection.Open(); | |
return connection; | |
} |
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
<# | |
SOURCE: https://www.simple-talk.com/sql/database-administration/automated-script-generation-with-powershell-and-smo/ | |
See script options and defaults in comment block at end of file | |
or look here for the official list: | |
https://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.scriptingoptions.aspx | |
Override any defaaults you want in the script below | |
#> | |
$Filepath='E:\MyScriptsDirectory' # local directory to save build-scripts to | |
$DataSource='MyServer' # server name and instance | |
$Database='MyDatabase'# the database to copy from |
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
<!-- This script supplied by Bill Anton http://byobi.com/blog/2013/06/extended-events-for-analysis-services/ --> | |
<!-- Blog post on how to use this: http://markvsql.com/2014/02/introduction-to-analysis-services-extended-events/ --> | |
<Create | |
xmlns="http://schemas.microsoft.com/analysisservices/2003/engine" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" | |
xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" | |
xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" | |
xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200" | |
xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300"> |
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
Sub TestCreateDirIfNeeded() | |
Dim path As String | |
path = "C:\imarealboy" | |
CreateDirIfNeeded (path) | |
End Sub | |
Sub CreateDirIfNeeded(path As String) | |
On Error Resume Next | |
MkDir path | |
On Error GoTo 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
// run the following from the console | |
document.getElementsByTagName('video')[0].playbackRate=2 |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
# https://stackoverflow.com/questions/29873439/how-do-i-update-all-chocolatey-apps-without-confirmation/30428182#30428182 | |
# tldr: choco feature enable -n=allowGlobalConfirmation | |
cinst launchy | |
cinst ditto | |
cinst beyondcompare | |
cinst instanteyedropper | |
cinst 7zip | |
cinst linqpad | |
cinst cmder |