
Node got some shiny new goodies with this current release:
specifically: fs.copyFile and fs.copyFileSync
still lacking: fs.mkdirp and fs.remrf
Full release notes: https://nodejs.org/en/blog/release/v8.5.0/
There are 32 posts filed in Programming (this is page 2 of 4).
Node got some shiny new goodies with this current release:
specifically: fs.copyFile and fs.copyFileSync
still lacking: fs.mkdirp and fs.remrf
Full release notes: https://nodejs.org/en/blog/release/v8.5.0/
React Conference livestream is starting: http://conf.reactjs.org/livestream
Strange to see them using YouTube Live instead of Facebook live video
I keep a boilerplate Rails 5 API-only app among my repos for rapid API building, but sometimes I just want a basic structure to query against (without having to deal with a complete stand alone Rails app).
Enter: json-schema-faker and json-server
Cory House has put together a great tutorial on how to build and serve a json database in 3 easy steps: https://medium.freecodecamp.org/rapid-development-via-mock-apis-e559087be066
First you’ll need to add your production box IP address to Exchange Connector
Example URL: https://outlook.office365.com/ecp/?rfr=Admin_o365&exsvurl=1&Realm=yourdomain.com
Then add the following to application production.rb
1 2 3 4 5 6 7 8 9 10 |
config.action_mailer.raise_delivery_errors = true config.action_mailer.delivery_method = :smtp config.action_mailer.perform_deliveries = true config.action_mailer.smtp_settings = { :address => "yourdomain-com.mail.protection.outlook.com", :from => 'somesendername@yourdomain.com', :port => 25, :domain => "yourdomain.com", :enable_starttls_auto => true } |
and boom! your Rails app will start sending emails through Office 365.
Once you’ve got your certs all setup you can add an entry to /etc/nginx/sites-available and then symlink it to /etc/nginx/site-enabled
An example snippet below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
server { listen 443; ssl on; ssl_certificate /home/deploy/.ssl/mydomain_combined.crt; ssl_certificate_key /home/deploy/.ssl/mydomain.key; server_name myawesomedomain.com; passenger_enabled on; rails_env production; root /home/deploy/apps/my-app/current/public; passenger_ruby /home/deploy/.rvm/gems/ruby-2.2.2@my-app/wrappers/ru$ access_log /home/deploy/apps/my-app/current/log/access.log; error_log /home/deploy/apps/my-app/current/log/error.log; # redirect server error pages to the static page /50x$ error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } |
Jesse Wolgamott has helped arrange a Ruby Hack-n-hired meetup at the Companion offices tonight! Companion is currently seeking a Junior Ruby Developer.
This will be an excellent opportunity to meet other Ruby developers and learn more about the Companion Dx product offering and sample workflow.
Simple check to determine the speed of user input into a form element. This was to prevent users from typing in barcodes that were required to be entered using a barcode scanner.
HTML:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
<!DOCTYPE html> <html> <head lang="en"> <link type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" /> <script src="https://code.jquery.com/jquery-2.1.3.min.js"></script> <script src="check-input-speed.js"></script> <meta charset="UTF-8"> <title>Monitor Form Input Speed</title> </head> <body> <div class="row"> <div class="col-md-2"></div> <div class="col-md-8"> <h2>Human or Barcode Scanner?</h2> <form> <input type="text" id="input_to_check" class="form-control" /> <div class="row"> <div class="col-md-12"> <span id="CPM">0</span> </div> </div> </form> <div id="analysis"> <div class="alert alert-danger" id="human"> HUMAN! </div> <div class="alert alert-success" id="barcode_scanner"> BARCODE SCANNER! </div> </div> </div> </div> </body> </html> |
JavaScript:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
$(function() { $("#human,#barcode_scanner").hide(); $("#input_to_check") .keyup(checkSpeed) .focus(); }); var iLastTime = 0; var iTime = 0; var iTotal = 0; var iKeys = 0; function checkSpeed() { iTime = new Date().getTime(); var cpm, wpm = 0; if (iLastTime != 0) { iKeys++; iTotal += iTime - iLastTime; cpm = Math.round(iKeys / iTotal * 6000, 2); $("#CPM").html("Characters per min: " + cpm); if (cpm < 300) { $("#human").show(); $("#barcode_scanner").hide(); } else { $("#human").hide(); $("#barcode_scanner").show(); } } iLastTime = iTime; } |
I remember when I thought Script.aculo.us, MooTools, Prototype, Backbone, and jQuery were all revolutionary. Now we have Node.js and the ability to run a server using JS.
My understanding is that Node is a C++ app that wraps the Google V8 engine and extends its ability. You get access to the underlying C++ by way of JavaScript. Incredible.
I have a distinct appreciation for JS because of it being based on the ECMAScript specification, which is the same standard that ActionScript3 was created. Looks like it might be time to transpile some my old AS3 files over into JS.
That’s Web Application Testing in Ruby.
There are so many reasons why you can/should use this gem. I’ve used this gem as a low level bot of sorts.
Pro Tip: It can get wicked powerful if you wrap it with some nokogiri parsing.
Personally, I just like how it looks like there’s a ghost sitting at the machine working on a browser.
I’m meeting with Adan from Hamilton today to review the automated output from our LIMS that will serve as the input for the Hamilton machine we’re running.
We’re going to be doing most of our testing on 384 well plate.
The constraints of the SOP and the optimization of the Hamilton tip travel time made for a unique blend of puzzle pieces.
Looking forward to seeing it go!