This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When /^I fill in "([^\"]*)" with:$/ do |field, string| | |
fill_in(field, :with => string) | |
end | |
Then /^I should not see a "([^\"]*)" button$/ do |button_name| | |
lambda { | |
When %Q{I press "#{button_name}"} | |
}.should raise_error(Capybara::ElementNotFound) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<title>Twitter</title> | |
<link rel="stylesheet" href="/stylesheets/main.css" type="text/css" media="screen" title="no title" charset="utf-8" /> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.Widget.Trending: class TrendingWidget extends Widget | |
constructor: (config) -> | |
Widget.Trending.instance: this | |
@template: """ | |
<div class='widget small trending'> | |
<ul> | |
{{#topics}} | |
<li class='down'>{{name}}</li> | |
{{/topics}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Symbol to Proc is a mutha' fucking dirty hack. It brings the indirection | |
# that we hated from Pearl to Ruby. How it made it into core I don't know. | |
# Anyway, rather than bitch and moan too much, here is an alternative method | |
# which is much more expressive and has the same number of characters. The | |
# name pick comes from Rebol, though it functions more like select there. | |
# Benchmark: | |
# user system total real | |
# 0.200000 0.000000 0.200000 ( 0.212325) | |
# 0.470000 0.000000 0.470000 ( 0.475471) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rack::SimpleServer | |
# | |
# a small rack app that acts like a basic HTTP server | |
# github.com/chendo | |
# | |
# Options: | |
# * :root => directory to expose | |
# e.g., use Rack::SimpleServer, :root => 'pub' | |
module Rack |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Disclaimer: my first bash script | |
# User purger - removes the user and their public keys from a system | |
# By chendo | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
read -p "Enter in part of public ssh key to search: " key | |
for f in `cut -d : -f 6 /etc/passwd`; do grep -nHs $key $f/.ssh/authorized_keys; done; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Instructions: | |
* | |
* Download to ~/.mailplane.css | |
* `defaults write com.mailplaneapp.Mailplane WebKitUserStyleSheetLocationPreferenceKey -string ~/.mailplane.css` | |
* `defaults write com.mailplaneapp.Mailplane WebKitUserStyleSheetEnabledPreferenceKey -bool true` | |
* | |
*/ | |
body { | |
font-family: Helvetica; !important |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What did you do to get good at Rails? | |
I just kept at it and worked with it on a professional basis. Constantly learning about new things and working with people who do Rails is also a good start. | |
Who taught you what you know? | |
The internet, friends/coworkers and Dr Nic. That, and trial and error. I guess one of the benefits of Rails is many things are implicit and make sense, but sometimes it has quirks and the internet documents a lot of these quirks. | |
Do you have any fond (or not so fond) memories of your learning experiences? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Symbol#to_proc is already defined in Rails | |
class Symbol | |
def to_proc | |
Proc.new { |item| item.send self } | |
end | |
end | |
class Array | |
def to_proc | |
Proc.new do |item| |