- Cez
Computer:
- MacOS Sierra
- OSX 10.12.6
- MacBook Pro 13" 2.5 intel i5
| function enableButtons () { | |
| // removes a "disabled" class when all form inputs have value | |
| $("input").keyup(function() { | |
| var inputs = $(".form-field input"); | |
| for (var i = 0; i < inputs.length; i++) { | |
| if (!inputs[i].value) { | |
| $("button").addClass("disabled"); | |
| return; | |
| } | |
| } |
| # Puma occasionally doesn't kill all ruby processes | |
| # Find and kill the processes | |
| # Find pid of process running on specified port | |
| lsof -i :3000 | |
| # Kill process | |
| sudo kill -9 [pid] |
| # Start an HTTP server from a directory | |
| # Set a port (optional) | |
| function server() { | |
| local port="${1:-8888}" | |
| sleep 1 && open "http://localhost:${port}/" & | |
| # Set the default Content-Type to `text/plain` instead of `application/octet-stream` | |
| # And serve everything as UTF-8 (although not technically correct, this doesn’t break anything for binary files) | |
| python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port" | |
| } |
| https://medium.com/@katopz/how-to-upgrade-openssl-8d005554401 | |
| https://www.reddit.com/r/osx/comments/5oafqg/trouble_linking_openssl_on_osx_el_capitan/ | |
| #terminal .bash_profile | |
| export PATH=$(brew --prefix openssl)/bin:$PATH | |
| #ssl certs | |
| https://github.com/rubygems/rubygems/issues/1736 | |
| # manual solution to SSL issue |
| ### | |
| # Install new Ruby version | |
| # Locally or server-side | |
| ### | |
| # updating the list of ruby versions (ruby-build) to get the latest ones. | |
| # with Hombrew | |
| brew update && brew upgrade ruby-build | |
| # with rbenv plugin | |
| # https://github.com/rbenv/ruby-build |
| // | |
| // Reload (or initialize) addThis social share buttons. | |
| // Can be used for dynamic buttons after ajax. | |
| // | |
| // Insert addthis script tag in html page and replace with your correct pubid. | |
| // http://www.addthis.com/academy/sharing-button-api-overview/ | |
| // | |
| <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid={YOUR_PUBID_HERE}" async="async"></script> | |
| .... | |
| window.reinitializeAddThis = function() { |
| // | |
| // Mailgun Custom Address Validation API w/ v3 | |
| // | |
| // Include in form submit: | |
| // | |
| // email_validator(email_address, event, { | |
| // //api_key: ' api-key', | |
| // in_progress: in_progress_callback, // called when request is made to validator | |
| // success: success_callback, // called when validator has returned | |
| // error: validation_error // called when an error reaching the validator has occured |