Skip to content

Instantly share code, notes, and snippets.

@laribee
laribee / 1_thoughts.md
Created March 23, 2012 00:31
npm+commonjs vs. rubygems

So What's The Deal With Package Managers?!

The background twitter conversation...

I tried to make it clear in the comments, but...

NPM wins because it's explicit and local (usually). It combines bundler + gems (in a way). You know where shit's coming from because of the module pattern (which is the real hero here, let's be honest).

@laribee
laribee / gist:2628424
Created May 7, 2012 15:30
OO step defs per feature
class AssetLinkStepDefinitions
include PageObject::PageFactory
include Cucumber::RbSupport::RbDsl
def run(browser)
@browser = browser
data = FeatureData[:asset_link].create
# OK
def dilettante
content = []
other_extended_fields_element.div_elements(:class => 'text').each do |c|
content << c.label.text
end
content
end
# BETTER!
@laribee
laribee / Ubiquitron.md
Created July 10, 2012 04:34
Ubiquitous Language

The Ubiquitous Language

We want to live our domain. We want to eat it, to consume it. Most of all, we want to share this language from user to code.

This is the ubiquitous language.

It is free from ambiguity. We talk about these things. In our codebase, we find classes and objects named after these things. The ubiquitous language, the language we all use, eliminates impedance... it puts us all on the same key... it is all how we get along

You, Ubiquitron

SELECT TOP (100) PERCENT dbo.Forum.ID AS ForumID
, I.ID AS IdeaID
, (SELECT COUNT(*) FROM dbo.Vote WHERE (Idea_id = I.ID)) AS VoteCount
, (SELECT COUNT(*) FROM dbo.Comment WHERE (Idea_id = I.ID)) AS CommentCount
FROM dbo.Idea AS I
INNER JOIN dbo.Category ON I.Category_id = dbo.Category.ID
INNER JOIN dbo.Forum ON dbo.Category.Forum_id = dbo.Forum.ID
GROUP BY I.ID, dbo.Forum.ID
ORDER BY ForumID, IdeaID
@laribee
laribee / gist:5760490
Last active December 18, 2015 09:19
bowlin'
using System.Collections;
using System.Collections.Generic;
using MbUnit.Framework;
namespace specs_for_bowling
{
[TestFixture]
public class when_everything_is_wired_up
{
public string WhatsWrongWithThisMethod(string something)
{
_state.Set(something);
return _internalState;
}
@laribee
laribee / docker-compose.yml
Created March 12, 2017 02:09
Drone + Gogs Docker Compose File
gogs:
image: gogs/gogs:latest
ports:
- "10021:3000"
- "10022:22"
volumes:
- ./data:/data
drone:
image: drone/drone:0.4
ports:
#!groovy
/*
The MIT License
Copyright (c) 2015-, CloudBees, Inc., and a number of other of contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@laribee
laribee / customize.sh
Created March 12, 2017 06:51
Customize Git
#!/bin/bash
git config --global alias.lg \
”log --color --graph \
--pretty=format:’%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit”
git lg
git lg -p
git clone https://github.com/nerdnoir/dockerize-node.git