go to the begin of the line : ctrl-a
go to the end of the line : ctrl-e
delete the line : ctrl-n
| default: &default | |
| adapter: mysql2 | |
| encoding: utf8mb4 | |
| username: root | |
| password: | |
| host: 127.0.0.1 | |
| port: 3306 | |
| development: | |
| <<: *default |
| require 'rmagick' | |
| def resize(file_path) | |
| file = Image.new |
| require 'phonelib' | |
| number = "9549233221" | |
| country = "US" | |
| puts "\nPhonelib.valid_for_country? '#{number}', '#{country}' :" | |
| puts Phonelib.valid_for_country? number, country | |
| # this was surprisingly difficult to find, the documentation and API is poor | |
| require "net/http" | |
| require "uri" | |
| url = URI.parse("http://www.whatismyip.com/automation/n09230945.asp") | |
| req = Net::HTTP::Get.new(url.path) | |
| req.add_field("X-Forwarded-For", "0.0.0.0") | |
| # For content type, you could also use content_type=(type, params={}) |
Automatic fonctional tests can be created with the Selenium extension on the browser Firefox. Selenium tests are located in the folder tests/selenium.
You can follow this tutorial to create a new test.
To let time to the jQuery to understand what's going on, add the pause commande , exemple jquery wait for an ajax request to append the results the a form input.
Here is the basic command, it follow the same syntaxe has the selenium log : | command | param1 | param2 | .
| sfgsefgdfgsdfgs |
| function sketchProc(processing) { | |
| // Override draw function, by default it will be called 60 times per second | |
| processing.draw = function() { | |
| // determine center and max clock arm length | |
| var centerX = processing.width / 2, centerY = processing.height / 2; | |
| var maxArmLength = Math.min(centerX, centerY); | |
| function drawArm(position, lengthScale, weight) { | |
| processing.strokeWeight(weight); | |
| processing.line(centerX, centerY, | |
| centerX + Math.sin(position * 2 * Math.PI) * lengthScale * maxArmLength, |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <link href="http://fonts.googleapis.com/css?family=Miltonian+Tattoo" rel"stylesheet" type="text/css"> | |
| <style type="text/css"> | |
| body{margin:15px;} | |
| h1{font-family: "Miltonian Tattoo", cursive;} | |
| div{} |