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
///<summary> | |
///When POSTing using PostFilesWithRequest, each individual files posted must bring metadata. So that the class can craete multipart request. | |
///</summary> | |
public class FileStreamInfo | |
{ | |
public Stream InputStream { get; set; } | |
public string Filename { get; 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
using System; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.IO; | |
using System.Reflection; | |
using System.Text; | |
using System.Web; | |
using System.Web.Mvc; | |
namespace webnetconf.website.Helpers |
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
REM Remove folder Sample/packages from GIT repository | |
git --filter-branch --index-filter "git rm --cached --ignore-unmatch -rf Sample/package" --prune-empty --tag-name-filter cat -- --all | |
REM Remove file Sample/packages/filetoremove.txt from GIT repository | |
git --filter-branch --index-filter "git rm --cached --ignore-unmatch Sample/package/filetoremove.txt" --prune-empty --tag-name-filter cat -- --all | |
REM push the result to origin | |
git push origin --force --all | |
git push origin --force --tags |
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
REM rename branch in local | |
git branch -m old_branch new_branch | |
REM delete old branch in ORIGIN | |
git push origin :old_branch | |
REM set new branch to track ORIGIN | |
git push --set-upstream origin new_branch | |
REM re-sync remote branch to local, removing deleted remote | |
git fetch origin --prune |
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
/* 1 */ | |
{ | |
"_id" : "joe", | |
"name" : "Joe Bookreader", | |
"addresses" : [ | |
{ | |
"street" : "123 Fake Street", | |
"city" : "Faketon", | |
"state" : "MA", | |
"zip" : "12345" |
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
# Defines date range of the news | |
$startDate = Get-Date "2016-01-01" | |
$endDate = Get-Date | |
# Defines file capture location | |
$fileCapture = "C:\temp\detik.txt" | |
$detikApi = "http://apis.detik.com/v1/indeks?limit=500&channelid=10>={0:yyyy-MM-dd HH:mm:ss}<={1:yyyy-MM-dd HH:mm:ss}" | |
$currentDate = $startDate | |
do { | |
$nextDate = $currentDate.AddMonths(1) |
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
# Defines file capture location | |
$fileCapture = "C:\temp\detik.txt" | |
# List of target RSS - you can add more | |
$targetRSS = "detikcom_nasional", "detikcom_internasional", "detikcom_bbc","detikcom_lapsus","detikcom_wawancara"," detikcom_prokontra" | |
$targetRSS |% { | |
$url = "http://rss.detik.com/index.php/" + $_ | |
$targetXml = "C:\temp\" + $_ + ".xml" | |
Invoke-WebRequest -Uri $url -OutFile $targetXml -ErrorAction Stop |
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
<configuration> | |
<system.webServer> | |
<httpProtocol> | |
<customHeaders> | |
<clear /> | |
<remove name="X-Powered-By" /> | |
<add name="X-Frame-Options" value="SAMEORIGIN" /> | |
</customHeaders> | |
</httpProtocol> | |
</system.webServer> |
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
<configuration> | |
<system.webServer> | |
<modules runAllManagedModulesForAllRequests="true"> | |
<add name="CustomHttpModule" type="Custom.ServerModules.CustomHttpHeaderModule" /> | |
</modules> | |
</system.webServer> | |
</configuration> |
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
<configuration> | |
<system.serviceModel> | |
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> | |
</system.serviceModel> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<rule name="ReverseProxy" stopProcessing="true"> | |
<match url=".*" /> |
OlderNewer