Skip to content

Instantly share code, notes, and snippets.

[Fact]
public void UrlWithinQuotes()
{
//arrange
var message = "This is a sentence with quotes and a url ... see \"http://foo.com\"";
HashSet<string> extractedUrls;
//act
var result = TextTransform.TransformAndExtractUrls(message, out extractedUrls);
<table id="posts">
<thead>
<tr>
<th>ID</th>
<th>Title</th>
<th>Date Created</th>
<th>Published</th>
</tr>
</thead>
<tbody>
@samandmoore
samandmoore / java solution to var
Created May 15, 2013 16:56
java doesn't have var, so if you want to type less, you have to create a static factory...
// problem
Map<String, List<String>> map = new HashMap<String, List<String>>();
// --------------------------------------------------
// Java solution
public static <K, V> HashMap<K, V> newHashMap() {
return new HashMap<K, V>();
}
@samandmoore
samandmoore / baseRouteUsage.js
Last active August 29, 2015 14:15
beforeRender
var PortfolioRoute = BaseRoute.extend({
prepare: function() {
this.promise = …;
return this.promise;
},
render: function() { … },
error: function() { … }
});

Keybase proof

I hereby claim:

  • I am samandmoore on github.
  • I am samandmoore (https://keybase.io/samandmoore) on keybase.
  • I have a public key ASDPb_dntgaot_-UkwH9ffIECYnlcW-Njurs5AjRvYebzgo

To claim this, I am signing this object:

@samandmoore
samandmoore / output.sh
Created April 26, 2017 20:57
output safety rubocop issues
$ rails c
Loading development environment (Rails 4.2.7.1)
irb(main):001:0> include ActionView::Helpers::OutputSafetyHelper
=> Object
irb(main):002:0> raw "foo"
=> "foo"
irb(main):003:0> thing = raw "foo"
=> "foo"
irb(main):004:0> thing.class
=> ActiveSupport::SafeBuffer
#!/bin/bash
set -e
PROJECT_DIR="${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}"
# Workaround old docker images with incorrect $HOME
# check https://github.com/docker/docker/issues/2968 for details
if [ "${HOME}" = "/" ]
then
@samandmoore
samandmoore / file_a.dart
Created August 31, 2021 17:53
duplicate consts
const something = "";