View HelloWorld_1.cs
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
class HelloWorldJob: IJob { | |
public HelloWorldJob() {} | |
public void Execute(IJobExecutionContext context) { | |
try { | |
Console.WriteLine("Hi!-"); | |
} catch (Exception ex) {} | |
} | |
} |
View 2015-12-01-extjs-grid-page-size-letting-the-user-decide_001.js
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
Ext.define('Ext.toolbar.PagingComboToolbar', { | |
extend: 'Ext.PagingToolbar', | |
displayInfo: false, | |
pageSize: 50, | |
initComponent: function() { | |
var me = this; | |
this.store.pageSize = this.pageSize; | |
var combo = new Ext.form.ComboBox({ | |
name: 'perpage', | |
width: 75, |
View 2016-05-29-working-with-files-with-powershell_001.ps1
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
$configFiles = Get-ChildItem . *.js -rec | |
foreach ($file in $configFiles) | |
{ | |
Write-Host $file.Name | |
} |
View 2016-05-29-working-with-files-with-powershell_002.ps1
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
Get-ChildItem [ | |
[-Path] <String[]> ] | |
[[-Filter] <String>] | |
[-Exclude <String[]>] | |
[-Force] | |
[-Include <String[]>] | |
[-Name] | |
[-Recurse] | |
[-UseTransaction] | |
[<CommonParameters>] |
View 2016-05-29-working-with-files-with-powershell_003.ps1
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
$configFiles = Get-ChildItem . *.js -rec | |
foreach ($file in $configFiles) | |
{ | |
(Get-Content $file.PSPath) | | |
Foreach-Object { $_ -replace "TextToFind", "TextToReplaceBy" } | | |
Set-Content $file.PSPath | |
} |
View 2016-05-29-working-with-files-with-powershell_004.ps1
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
param([string]$cultureName='') | |
$localePath=’C:\Users\hbulens\Desktop\test\{0}.js’ -f $cultureName | |
$localeTemplate = "@ | |
Ext.onReady(function() { | |
if (Ext.util && Ext.util.Format) { | |
Ext.apply(Ext.util.Format, { | |
thousandSeparator: '.', | |
decimalSeparator: ',', | |
currencySign: 'R', |
View 2016-05-29-working-with-files-with-powershell_005.ps1
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
param([string]$fileName='') | |
$content = Get-Content $fileName | |
foreach ($line in $content) | |
{ | |
Write-Host $line | |
$scriptPath = '.\FileWithContentGenerator.ps1' | |
invoke-expression "$scriptPath $line" | |
} |
View 2016-05-29-working-with-files-with-powershell_006.txt
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.exe .\test.ps1 -parameter1 'HELLO FROM PARAMETER 1' -parameter2 'HELLO FROM PARAMETER 2' | |
Powershell.exe .\test.ps1 -parameter1 "HELLO FROM PARAMETER 1" -parameter2 'HELLO FROM PARAMETER 2' | |
set /p DUMMY=Hit ENTER to continue... |
View 2016-05-29-working-with-files-with-powershell_007.ps1
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
param([string]$parameter1, [string]$parameter2) | |
Write-Host $parameter1 $parameter2 |
View 2015-08-03-c-and-the-strava-web-api_001.cs
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
private T GetStravaData < T > (string url) { | |
try | |
{ | |
HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url); | |
using(WebResponse response = request.GetResponse()) | |
{ | |
using(Stream responseStream = response.GetResponseStream()) | |
{ | |
using(StreamReader reader = new StreamReader(responseStream, Encoding.UTF8)) | |
{ |
OlderNewer