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
static string GetOriginalUrl(string shortUrl) | |
{ | |
var httpRequest = (HttpWebRequest) WebRequest.Create(shortUrl); | |
httpRequest.Method = "HEAD"; | |
using (var response = httpRequest.GetResponse()) | |
return response.ResponseUri.AbsoluteUri; | |
} |
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
[assembly: log4net.Config.XmlConfigurator(Watch = true)] |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<targets> | |
<target name="coloredConsole" xsi:type="ColoredConsole" useDefaultRowHighlightingRules="false" | |
layout="${longdate}|${pad:padding=5:inner=${level:uppercase=true}}|${message}" > | |
<highlight-row condition="level == LogLevel.Debug" foregroundColor="DarkGray" /> | |
<highlight-row condition="level == LogLevel.Info" foregroundColor="Gray" /> | |
<highlight-row condition="level == LogLevel.Warn" foregroundColor="Yellow" /> |
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
.,{)\.@%!},,2= # is number prime (expects number on stack and adds 1 or 0 (leaves number on stack)) | |
:§,{)§\%!},,2= # just like above, except this consumes the number from the stack. | |
..,1>{*}*\%)= # shorter version, using Wilson's theorem (https://en.wikipedia.org/wiki/Wilson%27s_theorem) | |
# must take a parameter > 1, therwise fails |
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
git config --global user.name <user> | |
git config --global user.email <email> | |
git config --global help.autocorrect 1 | |
git config --global color.ui auto | |
git config --global core.autocrlf true | |
git config --global alias.glog "log --graph --oneline --all --decorate" | |
git config --global core.editor "C:/Windows/notepad.exe" |
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
[Test] | |
public void ComputeResultWithTimeout() | |
{ | |
var task = Task.Factory.StartNew(() => ComputeResult("bla")); | |
//task.Wait(0999); | |
task.Wait(1000); | |
if (task.IsCompleted) | |
Console.WriteLine("OK, got: " + task.Result); |
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
# use glob syntax | |
syntax: glob | |
*.obj | |
*.pdb | |
*.user | |
*.aps | |
*.pch | |
*.vspscc | |
*.vssscc |
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
Show hidden characters
{ | |
"cmd": ["ruby", "D:\\path\\to\\golfscript.rb", "$file"], | |
"selector": "source.gs" | |
} | |
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
public class RunnableInDebugOnlyAttribute : FactAttribute | |
{ | |
private string _skip; | |
public override string Skip | |
{ | |
get | |
{ | |
return Debugger.IsAttached | |
? _skip |
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
function getBackgroundColor(rangeSpecification) { | |
var sheet = SpreadsheetApp.getActiveSpreadsheet(); | |
return sheet.getRange(rangeSpecification).getBackground(); | |
} | |
function getForegroundColor(rangeSpecification) { | |
var sheet = SpreadsheetApp.getActiveSpreadsheet(); | |
return sheet.getRange(rangeSpecification).getFontColor(); | |
} |
OlderNewer