Skip to content

Instantly share code, notes, and snippets.

View anildigital's full-sized avatar
:octocat:

Anil Wadghule anildigital

:octocat:
View GitHub Profile
@glv
glv / experience_teaching_ruby_testing.md
Last active November 3, 2019 14:00
@tenderlove asked about the wisdom of teaching RSpec to new Ruby developers. I have some relevant experience. Here it is, for what it's worth.

Notes on teaching both test/unit and RSpec to new Ruby developers

@tenderlove asked "Is it good to teach RSpec (vs t/u) to people who are totally new to Ruby?" I have experience suggesting that it is a good thing; after a short back and forth, it seemed useful to write it up in detail.

Background

This goes back several years, to when I was the primary Ruby/Rails trainer for Relevance from 2006-2009. I'm guessing that worked out to probably 6-8 classes a year during those years. Since then, RSpec has changed a fair amount (with the addition of expect) and test/unit has changed radically (it has an entirely new implementation, minitest, that avoids some of the inconsistencies that made test/unit a bit confusing during the time I'm writing about here).

I started out as an RSpec skeptic. I've never been afraid of what a lot of people denigrate as "magic" in Ruby libraries … to me, if you take the trouble to understand it, that stuff's just pr

@toch
toch / operators.md
Created March 14, 2014 08:07
Ruby Punctuations or a list of names of operators and other cabalistic punctuation
Operator Name
=> hashrocket
<=> spaceship
=== threequals
~> twiddlewalka
-> stabby lambda
@ spiral
* splat
~ tidle
@ewindisch
ewindisch / gist:8959919
Created February 12, 2014 17:09
Remove docker images that aren't visible in 'docker images' (the images that only appear with 'images -a')
docker rmi $(comm -3 <(docker images -q | sort) <(docker images -q -a | sort) | sed 's/\t//')
@mtnygard
mtnygard / gist:7555463
Last active May 22, 2017 10:59
The limitations of test

From Out of the Tar Pit:

The key problem with testing is that a test (of any kind) that uses one particular set of inputs tells you nothing at all about the behaviour of the system or component when it is given a different set of inputs. The huge number of different possible inputs usually rules out the possibility of testing them all, hence the unavoidable concern with testing will always be — have you performed the right tests?. The only certain answer you will ever get to this question is an answer in the negative — when the system breaks.

This is a strong argument for some form of generative, simulation, or property-based testing.

@wsargent
wsargent / docker_cheat.md
Last active June 29, 2024 19:32
Docker cheat sheet
@ryankennedy
ryankennedy / Audited.java
Created September 24, 2013 17:48
Example of adding audited REST endpoints to a Dropwizard service.
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Audited {
}
@missingfaktor
missingfaktor / gist:6018320
Last active December 19, 2015 21:09
Easing the use of EmbeddedDocument pattern in Ruby
require 'json'
require 'date'
# Embedders
def scalar
lambda { |x| x }
end
def date
@jkresner
jkresner / test-passport.coffee
Created June 20, 2013 17:50
Passport.js user mocking version 2
users = require './../data/users'
data = users: []
data.users.anon = authenticated: false
data.users.admin = users[0]
data.users.jk = users[1]
data.users.artle = users[5]
data.users.beountain = users[4]
setSession = (userKey) ->
@aaronbuchanan
aaronbuchanan / gist:5341619
Created April 8, 2013 23:47
UI/UX OmniGraffle Stencils
A bunch of stenciles for wireframing, data & user flow diagrams and more:
Empty Chrome Browser Window:
https://www.graffletopia.com/stencils/938
Twitter Bootstrap UI:
https://www.graffletopia.com/stencils/934
Google Web GUI:
https://www.graffletopia.com/stencils/10431
@mutewinter
mutewinter / Alfred 3 Workflows.md
Last active November 25, 2020 14:14
A list of Alfred 3 workflows I'm using.