Skip to content

Instantly share code, notes, and snippets.

View distributedlife's full-sized avatar

Ryan Boucher distributedlife

View GitHub Profile
@distributedlife
distributedlife / 1.c
Last active December 28, 2015 04:59
distributedlife.com blog post code snippets
lr_save_string (MyCharStarString, "MyParameter") ;
@distributedlife
distributedlife / 1.c
Last active December 28, 2015 04:58
distributedlife.com old blog post code snippets
//Result Validation
{
ExtractResult () ;
CheckResultCountEquals (1) ;
CheckAwesomePersonAgainstServiceResponse
(
lr_get ("{Result_AwesomePerson_1_Id}"),
lr_get ("{Result_AwesomePerson_1_Name}"),
@distributedlife
distributedlife / 1.xml
Last active December 28, 2015 04:49
distributedlife.com blog posts
<services>
<service name="My.Service.Name">
<endpoint name="Endpoint One">
<operation name="GetAwesomePeople">
<aspect name="Input Validation" start="22/03/2010 - 2:02:17" finish="22/03/2010 - 2:02:23">
<case name="Name not supplied" start="22/03/2010 - 2:02:18" finish="22/03/2010 - 2:02:20" result="failed" />
<case name="Name is larger than db value" start="22/03/2010 - 2:02:20" finish="22/03/2010 - 2:02:20" result="passed" />
<case name="Name is one char" start="22/03/2010 - 2:02:20" finish="22/03/2010 - 2:02:21" result="passed" />
<case name="Awesome person does not exist" start="22/03/2010 - 2:02:21" finish="22/03/2010 - 2:02:22" result="failed" />
</aspect>
@distributedlife
distributedlife / 1.c
Last active December 28, 2015 02:39
distributedlife.com blog post code snippets
void DeleteFile (const char* const filename)
{
lr_set (filename, "__DeleteFile_filename") ;
system ("del /S /Q {__DeleteFile_filename}") ;
}
@distributedlife
distributedlife / 1.cpp
Last active December 28, 2015 01:49
code snippets from distributedlife.com blog
if (collection->getCatalogue()->isMatch((*objectItr)->m_element))
{
// we have our match, catalogue is unchanged
}
//OR
if (collection->getCatalogue()->isMatch((*objectItr)->m_element), true)
{
// we have a match and our catalogue was updated
@distributedlife
distributedlife / 1.py
Last active December 27, 2015 09:09
snippets for improve this from november 2013 - p2 magazine
a = [[], [], [], []]
width = 10
length = 4
stones = 2 # or 3
for i in range(length):
for j in range(width):
a[i].append(stones)
if i == 1 and j == width - 2:
a[i][j] = 1
@distributedlife
distributedlife / 1.story
Last active December 27, 2015 08:49
snippets for 4 ways to split a story from November 2013 Issue of P2
As a user, I want to search for my customers by their first and last names.
As a non-administrative user, I want to modify my own schedules but not the schedules of other users.
As a mobile application tester, I want to test my test cases and report results to my management.
for (( c=0; c<=854; c += 10 )) do
wget -k "http://oeis.org/search?q=2,4,6,8&start=$c&fmt=data" -O $c.html;
done
class NetworkMessage implements MessageSender {
public send(Message message) {
//things occur
}
};
@distributedlife
distributedlife / 1.clj
Last active December 24, 2015 01:29
P2 - cooking with clojure - gists
(def y 3)
(+ 2 y)
;=> 5
(reduce + [2 3 4 5])
;=> 14