duplicates = multiple editions
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
find spec -name '*.rb' | xargs sed -i '' -E 's/([^.]|^)stub([^_]|$)/\1double\2/g' |
#!/usr/bin/env bash | |
set -e | |
# copy_bower_components - A very simple bash script for copying your Bower | |
# components over to your rails vendor/assets folder. | |
# | |
# Copyright (c) 2013 Mark Przepiora | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal |
# Models | |
class Post < ActiveRecord::Base | |
after_save :do_something_to_tags | |
has_many :post_tags, inverse_of: :post | |
has_many :tags, through: :post_tags | |
def do_something_to_tags | |
puts "The following line in Rails 4.2 incorrectly joins on post_id = NULL" |
if [ ! -f Serge\ Lang\ -\ SL2\(R\)\ \(978-1-4612-5142-2\).pdf ]; then | |
echo "downloading 978-1-4612-5142-2" | |
curl -L http://link.springer.com/content/pdf/10.1007/978-1-4612-5142-2.pdf > Serge\ Lang\ -\ SL2\(R\)\ \(978-1-4612-5142-2\).pdf.tmp | |
mv Serge\ Lang\ -\ SL2\(R\)\ \(978-1-4612-5142-2\).pdf{.tmp,} | |
fi | |
if [ ! -f David\ Cox\ John\ Little\ Donal\ OShea\ -\ Ideals,\ Varieties,\ and\ Algorithms\ \(978-1-4757-2693-0\).pdf ]; then | |
echo "downloading 978-1-4757-2693-0" | |
curl -L http://link.springer.com/content/pdf/10.1007/978-1-4757-2693-0.pdf > David\ Cox\ John\ Little\ Donal\ OShea\ -\ Ideals,\ Varieties,\ and\ Algorithms\ \(978-1-4757-2693-0\).pdf.tmp | |
mv David\ Cox\ John\ Little\ Donal\ OShea\ -\ Ideals,\ Varieties,\ and\ Algorithms\ \(978-1-4757-2693-0\).pdf{.tmp,} | |
fi |
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
model: null, | |
actions: { | |
// This is fired when the user selects a new time zone | |
// from the dropdown. | |
changeTimeZone(tz) { | |
this.set('model.timeZone', tz); |
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
model: null, | |
actions: { | |
// This is fired when the user selects a new time zone | |
// from the dropdown. | |
changeTimeZone(tz) { | |
this.set('model.timeZone', tz); |
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
actions: { | |
clickOutside(event) { | |
const $target = Ember.$(event.target); | |
const clickedOutside = typeof $target.data('outside') !== 'undefined'; | |
alert("Clicked outside: " + (clickedOutside ? "yes" : "no")); | |
}, |
# Example: | |
# | |
# Content.find_each.with_progress{ |c| do_something(c) } | |
# | |
# Will do_something to each content and print out a nice progress bar as it goes | |
class Enumerator | |
def with_progress | |
return to_enum(__callee__) unless block_given? | |
bar_chars = %w( ▏ ▎ ▍ ▌ ▋ ▊ ▉ ) |
psql --dbname=postgres --no-psqlrc -c "DROP DATABASE IF EXISTS app_test;" | |
psql --dbname=postgres --no-psqlrc -c "CREATE DATABASE app_test;" | |
psql --dbname=app_test --no-psqlrc -c < db/structure.sql | |
for n in $(seq 2 $parallel_tests_count); do | |
( | |
psql --dbname=postgres --no-psqlrc -c "DROP DATABASE IF EXISTS app_test$n;" | |
psql --dbname=postgres --no-psqlrc -c "CREATE DATABASE app_test$n WITH TEMPLATE app_test;" | |
) & | |
done |