Skip to content

Instantly share code, notes, and snippets.

':wright.freenode.net NOTICE * :*** Looking up your hostname...\r\n:wright.freenode.net NOTICE * :*** Checking Ident\r\n:wright.freenode.net NOTICE * :*** Found your hostname\r\n:wright.freenode.net NOTICE * :*** No Ident response\r\n:wright.freenode.net 437 * testbot :Nick/channel is temporarily unavailable\r\nERROR :Closing Link: c-67-176-185-20.hsd1.in.comcast.net (Connection timed out)\r\n'
>>> import socket
>>> s=socket.socket()
>>> s.connect(("irc.freenode.net",6667))
>>> s.send("NICK :%s\r\n" % "testbot")
15
>>> s.send("USER %s %s bla :%s\r\n" % ("testbot","irc.freenode.net","testbot"))
44
>>> s.send("JOIN :%s\r\n" % "#dayly")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
@mfrost503
mfrost503 / bdd_story_2
Created October 28, 2012 02:36
BDD Story 2
/**
* @test
* Given that we're provided a valid number in kilometers
* Then we should be able to retrieve the miles equivalent
* @dataProvider getKmToMiles
**/
public function ConvertMilesToKilometers($km,$expected)
{
$this->distance
@mfrost503
mfrost503 / bdd_story_1
Created October 28, 2012 02:23
BDD Story 1
/**
* @test
* Given that we're provided a valid number in miles
* Then we should be able to retrieve the kilometer equivalent
* @dataProvider getMilesToKm
**/
public function ConvertMilesToKilometers($miles,$expected)
{
$this->distance
@mfrost503
mfrost503 / AccountHook.php
Created October 9, 2012 15:35
Account Logic Hook
<?php
/**
* This account hook would be run before save
**/
class AccountHook
{
public function setDBAName($bean,$event,$arguments)
{
$bean->dba_c = $bean->name;
<?php
/**
* This test addresses the following function requirements:
* Given that an Account is created (properly filled out and saved) then
* the DBA field (dba_c) should be populated with the name that was provided
* for the Account name
*
* This is a pretty common type of Sugar customization/enhancement that I've come
* across, so this test is how I would validate that my logic hook is working