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
// Old busted | |
private int count = 0; | |
public int Count | |
{ | |
get | |
{ | |
return count; | |
} | |
set | |
{ |
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
if $(ConfigurationName) == Release ( | |
nuget pack "$(ProjectDir)$(ProjectName).nuspec" | |
xcopy "$(TargetDir)*.nupkg" "C:\LocalNuget" /y | |
) ELSE ( | |
echo "Skipping nuget pack" | |
) |
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
$database = 'MyDatabaseName' | |
$instance = 'localhost\SQLEXPRESS' | |
$tables = Invoke-SqlCmd -Query "SELECT TABLE_NAME FROM [$database].INFORMATION_SCHEMA.Tables" -ServerInstance $instance -Database 'msdb' | |
foreach ($table in $tables) { | |
$tableName = $table.TABLE_NAME | |
Invoke-SqlCmd -Query "SELECT TOP 50 * FROM [$tableName]" -ServerInstance $instance -Database $database | | |
ConvertTo-Csv -Delimiter '|' -NoType | | |
ForEach-Object {$_.Replace('"','')}| | |
Out-file "C:\DATA\$tableName.csv" |
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
SELECT c.name AS ColName, t.name AS TableName | |
FROM sys.columns c | |
JOIN sys.tables t ON c.object_id = t.object_id | |
WHERE c.name LIKE '%MyName%' |
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
$reader = [System.IO.File]::OpenText("GitChuck.txt") | |
try { | |
cd C:\Users\Source\MyRepo | |
for(;;) { | |
$line = $reader.ReadLine() | |
if ($line -eq $null) { break } | |
if($line -like '*bin*' -Or $line -like '*obj*' -Or $line -like '*suo*' -Or $line -like '*user*') { | |
git rm --cached $line | |
} | |
} |
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
// Scrape visible task numbers | |
$('[id^="task-"] > div > span > span.key.ng-scope > a:visible').map(function() { | |
return $(this).text() | |
}) | |
.get() | |
.join('\n'); | |
// Scrape visible task numbers stories | |
$('[id^="task-"]> div > div.title.flux-lg-6.flux-order-lg-1.flux-md-12.flux-order-xs-4.flux-xs-12 > div:visible').map(function() { | |
return $(this).text() |
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
// Simple example for | |
// 1.) Read a sql server query to datatable; | |
// 2.) Export it to .csv | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var connectionString = @"data source=bla bla bla"; | |
var selectQuery = "select * from my-table;"; |
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
gwmi Win32_USBControllerDevice |%{[wmi]($_.Dependent)} | Sort Manufacturer,Description,DeviceID | Ft -GroupBy Manufacturer Description,Service,DeviceID |
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
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin | |
::Dev platforms and languages | |
choco install vcredist2010 --confirm | |
choco install nodejs.install --confirm | |
choco install ruby --confirm | |
choco install python2 --confirm | |
choco install redis-64 --confirm | |
choco install docker --confirm |
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
openssl x509 -outform der -in your-cert.pem -out your-cert.crt |
OlderNewer