Unistall rvm
( if there exists one )
rm -rf ~/.rvm
# This creates your rails site in the directory called 'davesite'. You can replace 'davesite' with anything that starts with a letter. | |
rails new davesite | |
#Change to the davesite directory. | |
cd davesite | |
#Logs you onto Heroku. You only really need to do this once unless you have multiple accounts | |
heroku login |
import cloudscraper | |
import pprint | |
import names | |
import time | |
UNSUBSCRIBE_URL = 'https://www.retailmenot.com/responsive/ajax/UnsubscribeMailerQueue.php' | |
APARTMENT_MAX_FLOOR = 6 | |
APARTMENT_MAX_UNIT = 7 |
require "benchmark/ips" | |
require_relative "./method_overloading" | |
class Foo | |
include MethodOverloading | |
def call(number) | |
"foo #{number}" | |
end | |
end |
MySQL | |
If the mysql2 gem fails to install, be sure your Xcode Command Line Tools are installed: | |
$ xcode-select --install | |
Then try reinstalling the gem with either of these 3 commands: | |
$ gem install mysql2 -- \ | |
--with-cflags=\"-I$(brew --prefix)/opt/openssl/include\" \ |
The normal controller/view flow is to display a view template corresponding to the current controller action, but sometimes we want to change that. We use render
in a controller when we want to respond within the current request, and redirect_to
when we want to spawn a new request.
The render
method is very overloaded in Rails. Most developers encounter it within the view template, using render :partial => 'form'
or render @post.comments
, but here we'll focus on usage within the controller.
An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.
Everything is broken up by tag, but within each the selectors aren't particularly ordered.
I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A
A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:
-webkit-appearance:none;
Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element
or the /deep/
path selector.
video::webkit-media-controls-timeline {
background-color: lime;
}
video /deep/ input[type=range] {
#!/usr/bin/env node | |
console.log('yay gist') |