$ cat /etc/apache2/sites-enabled/mms-test
Listen 50690
LogLevel debug
DumpIOInput On
# DumpIOOutput On
$ sudo tail -f /var/log/apache2/error.log | grep "mod_dumpio.c(74)" | sed "s/.*HEAP.: //"
| sudo rails server -b 0.0.0.0 -p 80 |
| class MyResource | |
| include HTTParty | |
| debug_output $stdout # <= will spit out all request details to the console | |
| #... | |
| end |
| class DriveAPI | |
| include HTTParty | |
| base_uri 'https://www.googleapis.com' | |
| #for debugging | |
| debug_output $stdout | |
| end | |
| def create_file(file_name, parent_id) | |
| check_token! | |
| access_token = current_user.access_token |
| / A simplistic way of loading and rendering HAML partials (header.haml, footer.haml, nav.haml... you name it) without Rails | |
| / Useful when using tools like LiveReload http://livereload.com/ | |
| / but don't want to configure a web server just to use PHP include/require constructs (discussion http://help.livereload.com/discussions/questions/22-haml-partials) | |
| / It could be improved/simplified using a helper http://stackoverflow.com/questions/5436769/partial-haml-templating-in-ruby-without-rails/5436973#5436973 | |
| / Check out the Jade version https://gist.github.com/2593727 | |
| %html | |
| %body | |
| %header | |
| = Haml::Engine.new(File.read('/path/to/your/partial.haml')).render |
| # How to install packages: | |
| # %%bash | |
| # pip install <package> |
| # Deploying NodeJS App on Google Cloud Platform | |
| `authored Jul 3 2015 by kengz` | |
| ## Installation | |
| - Account with Google Cloud Platform. | |
| - Install [Google Cloud Platform SDK](https://cloud.google.com/sdk/) to use `cloud` in the terminal. | |
| - Install [Docker](https://cloud.google.com/tutorials/install-docker) for the VM container. | |
| - Locally, login for the first time: `gcloud auth login` |
Thanks to: https://github.com/jennybc/googlesheets/edit/master/vignettes/managing-auth-tokens.md
Jenny Bryan
r Sys.Date()
| // SOURCE: http://davidwalsh.name/convert-image-data-uri-javascript | |
| function getDataUri(url, callback) { | |
| var image = new Image(); | |
| image.onload = function () { | |
| var canvas = document.createElement('canvas'); | |
| canvas.width = this.naturalWidth; // or 'width' if you want a special/scaled size | |
| canvas.height = this.naturalHeight; // or 'height' if you want a special/scaled size |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)