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
def favorite post | |
post.favorites.create!(user: current_user) | |
if post.user.email_settings.email_favorites? | |
UserMailer.favorite_email('Your post was favorited!', | |
"Good job! Your post was favorited. | |
#{link_to post_path(post), 'Have a look for yourself'}. \ | |
Your friendly social networking team.").deliver | |
end | |
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
def favorite post | |
favorite = post.favorites.create!(user: current_user) | |
post.user.notify_of favorite if post.user.likes_emails? | |
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
describe Bowling, "#score" do | |
it "returns 0 for all gutter game" do | |
bowling = Bowling.new | |
20.times { bowling.hit(0) } | |
bowling.score.should eq(0) | |
end | |
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
let webpack = require('webpack') | |
module.exports = { | |
devtool: 'inline-sourcemap', | |
context: __dirname, | |
entry: "./index.js", | |
output: { | |
path: "./js", | |
publicPath: '/js', | |
filename: "bundle.js" |
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
var express = require('express') | |
var app = express() | |
app.use(express.static('.')) | |
app.listen(3000, function () { | |
console.log('App listening on port 3000!') | |
}) |
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
#!/usr/bin/env ruby | |
# | |
# Adds a border around all the arguments passed to this script. | |
# | |
# Example: | |
# | |
# $ borderify hello you | |
# => 🄷 🄴 🄻 🄻 🄾 🅈 🄾 🅄 | |
LOOKUP_TABLE = { |
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
Play this game by pasting the script in http://www.puzzlescript.net/editor.html |
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
Play this game by pasting the script in http://www.puzzlescript.net/editor.html |
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
Play this game by pasting the script in http://www.puzzlescript.net/editor.html |
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
Play this game by pasting the script in http://www.puzzlescript.net/editor.html |