Skip to content

Instantly share code, notes, and snippets.

View jamesbar2's full-sized avatar

James Barnett jamesbar2

View GitHub Profile
#!/usr/bin/env bash
function __tc_encode {
# Only unicode characters are not supported
echo -n "$1" | sed "s/\([|']\)/\|\1/g; s/\[/\|\[/g; s/\]/\|\]/g; s/\r/\|r/g;" | sed ':a;N;$!ba;s/\n/|n/g'
}
function __tc_message {
echo "##teamcity[message text='$(__tc_encode "$2")' status='${1:-NORMAL}']"
}
function __tc_simple {
@DotNetNerd
DotNetNerd / PhantomRunner.cs
Created May 23, 2013 11:20
Grabbing a site in C# using phantomJS
class Program
{
static void Main(string[] args)
{
var grabby = new Grabby();
string output = grabby.Grab("http://www.dotnetnerd.dk/cv");
Console.WriteLine(output);
File.WriteAllText("c:\\test.html", output);
}