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
#!/usr/bin/env bash | |
if [ -f "$1" ]; then | |
strings "$1" | grep -o '[[:alnum:]+\.\_\-]*@[[:alnum:]+\.\_\-]*' | sort | uniq -i > emails_"$1" | |
else | |
echo "Expected a file at $1, but it doesn't exist." >&2 | |
exit 1 | |
fi |
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.Globalization; | |
using System.Threading; | |
using SimpleBrowser; | |
namespace ConsoleApplication19 | |
{ | |
public static class StringExtensions | |
{ | |
public static void Print(this string str, string prefix = null) |
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.Web; | |
using CsQuery; | |
namespace ConsoleApplication14 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
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.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace horrible.code.console { | |
public class SampleBaseClass { |
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
bcp "SELECT Line from db_WF_Log.dbo.tbLogs where Type = 'anticheat_report' and Processed = 0" queryout 'C:\temp\queryout.txt' -c -t, -S 10.30.0.51,1220 -T |
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 () { | |
var jQuery; | |
// If not present, load jquery | |
if (window.jQuery === undefined || window.jQuery.fn.jquery !== '1.4.2') { | |
createScriptReference("http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js", function () { | |
// Restore $ and window.jQuery to their previous values and store the | |
// new jQuery in our local jQuery variable | |
jQuery = window.jQuery.noConflict(true); | |
main(); | |
}); |
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 NoCacheAttribute : ActionFilterAttribute { | |
public override void OnResultExecuting(ResultExecutingContext filterContext) { | |
filterContext.HttpContext.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1)); | |
filterContext.HttpContext.Response.Cache.SetValidUntilExpires(false); | |
filterContext.HttpContext.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches); | |
filterContext.HttpContext.Response.Cache.SetCacheability(HttpCacheability.NoCache); | |
filterContext.HttpContext.Response.Cache.SetNoStore(); | |
base.OnResultExecuting(filterContext); | |
} | |
} |
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 ! [ -t 0 ]; then | |
read -a ref | |
fi | |
IFS='/' read -ra REF <<< "${ref[2]}" | |
branch="${REF[2]}" | |
if [ "lfreneda_novo_b2c" == "$branch" ]; then | |
URL='http://10.30.0.51:8081/job/dev.ecommerce.newb2c/build?delay=0sec' | |
wget.exe $URL | |
fi |
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
[TestFixture] | |
public class EncryptingDecryptingTests { | |
static byte[] GetBytes(string str) { | |
byte[] bytes = new byte[str.Length * sizeof(char)]; | |
System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length); | |
return bytes; | |
} | |
static string GetString(byte[] bytes) { |
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 Moq as usual | |
[Test] | |
public void EditItem_Post_WhenModelIsValid_ShouldRedirectToIndex() { | |
//Arrange | |
var shoppingCartStub = new Mock<IShoppingCartService>(); | |
shoppingCartStub.Setup(c => c.Change(It.IsAny<Guid>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<string>())); | |
var wcfServiceFactoryStub = new Mock<IWCFServiceFactory>(); | |
var controller = new BasketController(shoppingCartStub.Object, wcfServiceFactoryStub.Object); |